However I can single click an item in the Listview and then double click anywhere on the form and it does the same thing.
Obviously not exactly what I was trying to achieve

So ... what am I missing? I tried to move the #WM_LBUTTONDBLCLK case inside of a Select Gadget but that didn't work and I'm stumped.
Thanks in advance for helping me learn more about this great language ...

Code: Select all
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Listview_0
#String_0
EndEnumeration
Procedure Main_Proc()
If OpenWindow(#Window_0, 403, 270, 600, 300, "Listview DoubleClick Test", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
ListViewGadget(#Listview_0, 40, 30, 140, 180)
StringGadget(#String_0, 280, 30, 270, 30, "")
AddGadgetItem(#Listview_0, -1, "First Item")
AddGadgetItem(#Listview_0, -1, "Second Item")
AddGadgetItem(#Listview_0, -1, "LAST ITEM!")
SetGadgetState(#Listview_0, 0)
Repeat
Event.l = WaitWindowEvent()
Select Event
Case #WM_LBUTTONDBLCLK
SetGadgetText(#String_0, GetGadgetText(#Listview_0))
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
EndProcedure
Main_Proc() ; Program entry point