hello everyone,
Use the following code, Type characters in the edit box, it will be completed automatically
For example, when I type the letter a, the abc entry is automatically completed
I expect that:
1.If I press enter, the abc entry will be selected
What code do I need to add? Any suggestions are welcome. Thanks in advance
in addition
2.How to make editbox and combobox display the same content at the same time?
For example, when I type ab in the e4 editbox, the combobox cb3 displays ab at the same time
Macro Macro3
Use the following code, Type characters in the edit box, it will be completed automatically
For example, when I type the letter a, the abc entry is automatically completed
I expect that:
1.If I press enter, the abc entry will be selected
What code do I need to add? Any suggestions are welcome. Thanks in advance
in addition
2.How to make editbox and combobox display the same content at the same time?
For example, when I type ab in the e4 editbox, the combobox cb3 displays ab at the same time
Macro Macro3
_s=
;abc
;ba
;cp
;es
;fw
;hw
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 ComboBox 0x54230641 0x0 8 8 96 122 ""
;4 Edit 0x54030080 0x200 116 8 96 12 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040B01 "*" "" "" ""
str controls = "3 4"
str cb3 e4
cb3=_s
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case CBN_EDITCHANGE<<16|3
,sub.CB_AutoComplete lParam
ret 1
#sub CB_AutoComplete
function hcb
ifk(B) ret
ifk(X) ret
str s ss; int i
s.getwintext(hcb)
if(s.len)
,i=CB_FindItem(hcb s)
,if(i>=0)
,,CB_GetItemText(hcb i ss)
,,if(ss.len>s.len)
,,,ss.setwintext(hcb)
,,,SendMessage(hcb CB_SETEDITSEL 0 ss.len<<16|s.len)