Select field

  • Thread starter Thread starter AntoS
  • Start date Start date
A

AntoS

I'd like to create a field, like a select field but with one difference:

When a user press a key, the select normally goes to the first element that
begin with that char, then if the user press another char the selection goes
to the first element that begin with the last char pressed.

I need a field that if I press two o more chars consecutively it goes to the
option that begins with all of those chars.

How can I do that?

Thanks
 
Hi,

That is not a default feature of the combobox control, you can implement it
though.

0- Keep a member variable to hold the current value being entered ( use the
OnFocus event to set it to "" )
1- Intercept the KeyPressed event, mark it as handled
1.5- append the new char to the variable used to keep the value being
entered
2- From the selectedIndex search down until you find it
3- if nt found do what you think appropiated.

cheers,
 
Hi
You can create your own control that inhiret for normal combo and you can
implement that function with in it .
See http://www.codeproject.com/cs/miscctrl/WindowsDataGridColumns.asp
the article on that link discuss different issue" adding controls to
datagrid " however , the combobox that is used in it is inherited form the
default and it does the function you desire
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC
 
Back
Top