Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHAutoComplete
#13
It seems that it works.

Code:
Copy      Help
;/
function hcb

;Automatically completes when you type in combo box.
;Call from dialog procedure, on CBN_EDITCHANGE.
;hcb - combo box handle (use lParam).


;Allow to delete text from the end.

;EXAMPLE
,;case CBN_EDITCHANGE<<16|3
,;CB_AutoComplete lParam


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)
ifk(B)
,,str a.getwintext(hcb)
,,int s1 s2
,,SendMessage(hcb CB_GETEDITSEL &s1 &s2)
,,_i=s2-s1
,,_s.left(a a.len-_i)
,,_s.setwintext(hcb)
,,'E


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)