How to disable search i ListBox/ComboBox

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
 
S

Stoitcho Goutsev \(100\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top