Listview - FullRowSelect 
Author Message
 Listview - FullRowSelect

Does anyone know how to use the FullRowSelect property under eMVB (Listview
Control 3.0)  ? It seems the property doesn't exist. Is there an alternative
(except just working with one long column) ?

Thanks in advance

Thomas



Fri, 02 Jan 2004 22:16:48 GMT  
 Listview - FullRowSelect
Hi
try this courtesy of www.mvps.org I think Plus the bonus of sizing a
listview to the widest column or header

Pete

inilistview lvData

Declare Function SendMessage Lib "Coredll" Alias "SendMessageW" (ByVal hWnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As
Long
Const LVS_EX_FULLROWSELECT = &H20
Const LVM_GETEXTENDEDLISTVIEWSTYLE = &H1037
Const LVM_SETEXTENDEDLISTVIEWSTYLE = &H1036
Const LVM_SETCOLUMNWIDTH = &H101E
Const LVS_EX_HEADERDRAGDROP = &H10

Public Sub IniListView(myList As ListViewCtrl)

    myList.SetFocus
    lret = SendMessage(GetFocus(), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
    lret = lret Or LVS_EX_FULLROWSELECT Or LVS_EX_HEADERDRAGDROP
    Call SendMessage(GetFocus(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, lret)

End Sub

Public Sub lvAutosize(lv As ListViewCtrl) '
    lv.SetFocus
    Dim col2adjust As Long

    For col2adjust = 0 To lv.ColumnHeaders.Count - 1

      Call SendMessage(GetFocus(), _
                       LVM_SETCOLUMNWIDTH, _
                       col2adjust, _
                        -2)
    Next
End Sub

Quote:

> Does anyone know how to use the FullRowSelect property under eMVB
(Listview
> Control 3.0)  ? It seems the property doesn't exist. Is there an
alternative
> (except just working with one long column) ?

> Thanks in advance

> Thomas



Sat, 03 Jan 2004 04:41:58 GMT  
 Listview - FullRowSelect

Thanks !
It works great ! :)

Let me know whenever you are around (Germany).
We'll have a beer together ;)

Thomas

______________________________________________________

Public Declare Function GetFocus Lib "Coredll" Alias "GetFocus" () As Long

Let me know whenever you are Germany



Quote:
> Hi
> try this courtesy of www.mvps.org I think Plus the bonus of sizing a
> listview to the widest column or header

> Pete

> inilistview lvData

> Declare Function SendMessage Lib "Coredll" Alias "SendMessageW" (ByVal
hWnd
> As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
As
> Long
> Const LVS_EX_FULLROWSELECT = &H20
> Const LVM_GETEXTENDEDLISTVIEWSTYLE = &H1037
> Const LVM_SETEXTENDEDLISTVIEWSTYLE = &H1036
> Const LVM_SETCOLUMNWIDTH = &H101E
> Const LVS_EX_HEADERDRAGDROP = &H10

> Public Sub IniListView(myList As ListViewCtrl)

>     myList.SetFocus
>     lret = SendMessage(GetFocus(), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
>     lret = lret Or LVS_EX_FULLROWSELECT Or LVS_EX_HEADERDRAGDROP
>     Call SendMessage(GetFocus(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, lret)

> End Sub

> Public Sub lvAutosize(lv As ListViewCtrl) '
>     lv.SetFocus
>     Dim col2adjust As Long

>     For col2adjust = 0 To lv.ColumnHeaders.Count - 1

>       Call SendMessage(GetFocus(), _
>                        LVM_SETCOLUMNWIDTH, _
>                        col2adjust, _
>                         -2)
>     Next
> End Sub



- Show quoted text -

Quote:
> > Does anyone know how to use the FullRowSelect property under eMVB
> (Listview
> > Control 3.0)  ? It seems the property doesn't exist. Is there an
> alternative
> > (except just working with one long column) ?

> > Thanks in advance

> > Thomas



Sun, 04 Jan 2004 00:50:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. listview & fullrowselect

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

3. Problem Setting Listview's FullRowSelect Style

4. Fullrowselect in ListView-control (VB4 32)

5. Listview - Columns, FullrowSelect & RightAlign

6. Listview - Columns, FullrowSelect & RightAlign

7. Listview - Columns, FullrowSelect & RightAlign

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

9. Fullrowselect in listview

10. ListView control and FullRowSelect

11. Setting FullRowSelect on a ListView Control

12. When using FullRowSelect with LV how to?

 

 
Powered by phpBB® Forum Software