How to disable search i ListBox/ComboBox

  • Thread starter Thread starter BVM
  • Start date Start date
B

BVM

Hi, All:

In ListBox and ComboBox when you type a letter, say 'k', it will jump to the first item starting with 'k'. I want to disable it and do my own search that can search more than one letter, like 'kite', not just one character which ListBox currently does. But I cannot disable ListBox's own search. everytime when I type 'i', then jump to the item starting with 'i', not the one starting with 'ki'. Do you know how to disable it?

Thanks,

Dennis Huang
 
Dennis,

I don't think event the native combobos or list box have style or message that can help you with this. BTW the native listbox sends WM_CHARTOITEM notifcation, but only for owner draw listboxes that doesn have LBS_HASSTRING style.

The only way that I can suggest is to derive the listbox or combobox class, override the WndProc and filter the keyboard messages there. Send the arrow keys to the base implementation of the method and just process the characters by yourself.


--
HTH
Stoitcho Goutsev (100)
Hi, All:

In ListBox and ComboBox when you type a letter, say 'k', it will jump to the first item starting with 'k'. I want to disable it and do my own search that can search more than one letter, like 'kite', not just one character which ListBox currently does. But I cannot disable ListBox's own search. everytime when I type 'i', then jump to the item starting with 'i', not the one starting with 'ki'. Do you know how to disable it?

Thanks,

Dennis Huang
 
Back
Top