I cant get the %WM_LBUTTONUP event for single clicks in a listview, but i get them fine with double clicks. Like this:
Click [nothing]
Click [nothing] Click [%WM_LBUTTONUP]
How come?
do a search in the form for nm_click. That is better choice for handling listview clicks.
Hello Elias,
I usually handle listview mouse events in the forms Custom Event (See code example). That works ok. There might of course be better solutions.
Function FRMRECCURRENT_CUSTOM ( _
hWndForm As Dword, _ ' handle of Form
wMsg As Long, _ ' type of message
wParam As Dword, _ ' first message parameter
lParam As Long _ ' second message parameter
) As Long
Local lpNmh As NMHDR Ptr
Local lpLvNm As NM_LISTVIEW Ptr
Local lLvItem As Long
Local lLvSubItem As Long
Select Case wMsg
Case %WM_NOTIFY
lpNmh = lParam
If @lpNmh.idFrom = IDC_FRMRECCURRENT_LISTVIEW1 Then
lpLvNm = lParam
Select Case @LpLvNm.hdr.Code
Case %NM_DBLCLK 'left double-click
Case %NM_CLICK
Case %NM_RCLICK
Case Else
End Select
End If
Case Else
End Select
End Function
Rolf
Thanks guys. Perfect. :)
You are up late, Elias...