ListView control and FullRowSelect 
Author Message
 ListView control and FullRowSelect

I use the new IE 4.0 listview FullRowSelect flag for some of my listviews
the command I issue is

SendMessage objListView.hwnd, _
        LVM_SETEXTENDEDLISTVIEWSTYLE, _
        LVS_EX_FULLROWSELECT, _
        LVS_EX_FULLROWSELECT

in the got focus of the control

the problem is that it only seems to work about 85% of the time. Does
anybody know if this is a known problem or is there something else I should
be doing.

Thanks for the help
Rick



Mon, 11 Sep 2000 03:00:00 GMT  
 ListView control and FullRowSelect

I think the problem is you need to get the extended flags of the listview
and then add the ones you want..
here is a copy of a function I use ..I put it in the form load event

Public Sub EnableExtendedListview()
    Dim a As Long
    Dim rStyle As Long

    rStyle = SendMessageLong(lvwMain.hwnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&,
0&)

    rStyle = rStyle Or LVS_EX_TRACKSELECT _
            Or LVS_EX_GRIDLINES _
            Or LVS_EX_FULLROWSELECT _
            Or LVS_EX_HEADERDRAGDROP 'self explantory

    a = SendMessageLong(lvwMain.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&,
rStyle)

End Sub

hope that helps


Quote:
>I use the new IE 4.0 listview FullRowSelect flag for some of my listviews
>the command I issue is

>SendMessage objListView.hwnd, _
>        LVM_SETEXTENDEDLISTVIEWSTYLE, _
>        LVS_EX_FULLROWSELECT, _
>        LVS_EX_FULLROWSELECT

>in the got focus of the control

>the problem is that it only seems to work about 85% of the time. Does
>anybody know if this is a known problem or is there something else I should
>be doing.

>Thanks for the help
>Rick




Mon, 11 Sep 2000 03:00:00 GMT  
 ListView control and FullRowSelect

This should do it:

ListView1.View = lvwReport
Style& = SendMessageLong(ListView1.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0,
0)
Style& = Style& Or LVS_EX_FULLROWSELECT
Result& = SendMessageLong(ListView1.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
Style&)

When:

Const LVS_EX_FULLROWSELECT = &H20
Const LVM_FIRST = &H1000
Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA"
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam
As Long) As Long

Guy Cohen



Wed, 13 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Fullrowselect in ListView-control (VB4 32)

2. Setting FullRowSelect on a ListView Control

3. listview & fullrowselect

4. How to select entire row in ListView ? - FullRowSelect

5. Problem Setting Listview's FullRowSelect Style

6. Listview - Columns, FullrowSelect & RightAlign

7. Listview - Columns, FullrowSelect & RightAlign

8. Listview - Columns, FullrowSelect & RightAlign

9. Anyone gotten ListView SubItemImages + FullRowSelect + Sorting working?

10. Fullrowselect in listview

11. Listview - FullRowSelect

12. Copy all contents in a listview control to another listview control

 

 
Powered by phpBB® Forum Software