try this simple version dont change code at all
just copy code from here and run
this is a simple version no subclass, no right click, just double left click to select listbox item
Function Dialog10
the code you posted in macro8 has several issues. The biggest is you subclassed controls and set properties on those controls and don't remove them when dialog is closed.
just copy code from here and run
this is a simple version no subclass, no right click, just double left click to select listbox item
Function Dialog10
str- sItems="one[]two[]three"
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54030080 0x200 48 8 96 12 ""
;4 ListBox 0x54230101 0x200 48 24 96 48 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040802 "*" "" "" ""
str controls = "3 4"
str e3 lb4
lb4=sItems
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc v
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_TIMER
,sel wParam
,,case 1
,,KillTimer hDlg wParam
,,int hlb4=id(4 hDlg)
,,SendMessage hlb4 LB_RESETCONTENT 0 0
,,str s3 sEdit3.getwintext(id(3 hDlg))
,,foreach s3 sItems
,,,if(sEdit3.len and find(s3 sEdit3 0 1)<0) continue
,,,LB_Add hlb4 s3
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case LBN_DBLCLK<<16|4
,str lb4text
,_i=LB_SelectedItem(lParam lb4text)
,mes F"Selected listem number: {_i} Text: {lb4text}"
,case EN_CHANGE<<16|3
,SetTimer hDlg 1 10 0
,
ret 1
the code you posted in macro8 has several issues. The biggest is you subclassed controls and set properties on those controls and don't remove them when dialog is closed.