Listview header control question

Started by David J Walker, September 11, 2005, 10:42:22 PM

Previous topic - Next topic

David J Walker

I have a Listview with several columns.

How do I determine if a header is DC'ed, and which one it was?

I'm probably missing something here.

Thanks in advance!

Paul D. Elliott

If you mean double-clicked or even just plain clicked then

which = @lpNMV.iSubItem

in the LVN_COLUMNCLICK routine works. On the Designer just
double-click the header and it should create the routine for you.

If you need further help, just ask.

David J Walker


Haakon Birkeland

Hi Paul
Sorry to be dense but what do you mean by LVN_COLUMNCLICK.. I would like to write a function that will return the column header clicked on so I can sort the list view depenting on th column.

Bert
Haakon 8o)

David J Walker

Something like:

Function FORM1_LV1_LVN_COLUMNCLICK ( _
                                            ControlIndex  As Long,            _  ' index in Control Array
                                            hWndForm      As Dword,           _  ' handle of Form
                                            hWndControl   As Dword,           _  ' handle of Control
                                            ByVal lpNMV   As NM_LISTVIEW Ptr  _  ' pointer to NM_LISTVIEW
                                            ) As Long

If Sorting = %FALSE Then                                            
which& = @lpNMV.iSubItem
SortArray which&
End If

End Function


Firefly creates the function outline for you if you click on it in the top right selection list.

Haakon Birkeland

Thanx
I just couln't see the columnclick event in the listview

bert
Haakon 8o)