473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ComboBox Behavior in DropDownList

I am trying to create an incremental search feature within a ComboBox.
I'm finding the successive members of the list alright but I haven't
been able to figure out how to stop the ComboBox from changing the
SelectedItem when the user types a key.

Does anyone know how to turn off this 'feature'?
Nov 17 '05 #1
3 1637
Try handling it's KeyPress event, and set the "Handled" property, from
the System.Windows.Forms.KeyPressEventArgs paramiter, to true. You may
also try to override it's "OnKeyPress" member, and set it to true
before calling the base class' procedure.

Nov 17 '05 #2
Ron
<yo****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Try handling it's KeyPress event, and set the "Handled" property, from
the System.Windows.Forms.KeyPressEventArgs paramiter, to true. You may
also try to override it's "OnKeyPress" member, and set it to true
before calling the base class' procedure.

Another method would be to save the current SelectedIndex, and in the
SelectedIndex changed event, set the index back to the saved value.

HTH

Ron.
Nov 17 '05 #3
For the sake of posterity, check this out:

http://www.csharphelp.com/archives3/archive502.html

Found it in another thread.

Ron wrote:
<yo****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Try handling it's KeyPress event, and set the "Handled" property, from
the System.Windows.Forms.KeyPressEventArgs paramiter, to true. You may
also try to override it's "OnKeyPress" member, and set it to true
before calling the base class' procedure.


Another method would be to save the current SelectedIndex, and in the
SelectedIndex changed event, set the index back to the saved value.

HTH

Ron.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: hasden | last post by:
I'm working in .NET and I can't seem to get the behavior that I need from the combobox. I'm sure it's possible, I just don't have the .NET experience. Any help would be greatly appreciated. I need...
9
by: Strahimir Antoljak | last post by:
Could anyone help me with the following: Is there a quick, or at least known way to force a ComboBox, having DropDownStyle= DropDownList, to recognize keyboard input and perform Item selection...
2
by: Peter Proost | last post by:
Hi group could someone please confirm this behavior? Place a combobox on a form an add some items to it, then in the combobox_keyup event place the following code: combobox1.droppeddown = true...
19
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when...
4
by: genojoe | last post by:
I think there is a behavior bug in the combobox control. If you create a new form and add a combobox to it with the following code line to add items to it: Me.ComboBox1.Items.AddRange(New...
6
by: Matt | last post by:
I'm not entirely sure how to describe this issue. I have a number of ComboBoxes in my application which have their text properties bound to a field in a data set. The items loaded in the ComboBox...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
1
by: polocar | last post by:
Ciao a tutti, leggendo qua e lą per il forum ho scoperto che non sono l'unico ad avere questo problema. Se si inserisce un controllo ComboBox in un form di C#, non č possibile impostare la sua...
6
by: Nathan Laff | last post by:
Why when I inherit a ComboBox and make no code changes, when I set the new control DropDownStyle to dropDownList it appears different than the standard ComboBox control on Vista? In Windows...
6
by: Peter Larsen [CPH] | last post by:
Hi, How do i set DropDownWith in a asp.net ComboBox ?? Thank you in advance. BR Peter
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.