PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: David J Walker on September 11, 2005, 10:42:22 PM

Title: Listview header control question
Post by: David J Walker on September 11, 2005, 10:42:22 PM
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!
Title: Listview header control question
Post by: Paul D. Elliott on September 12, 2005, 02:25:31 PM
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.
Title: Listview header control question
Post by: David J Walker on September 12, 2005, 02:45:10 PM
Nice one, Paul!

Works a treat.
Title: Listview header control question
Post by: Haakon Birkeland on September 21, 2005, 05:42:25 PM
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
Title: Listview header control question
Post by: David J Walker on September 21, 2005, 06:19:36 PM
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.
Title: Listview header control question
Post by: Haakon Birkeland on September 21, 2005, 08:25:53 PM
Thanx
I just couln't see the columnclick event in the listview

bert