9.9. Use an Autocomplete Combo Box


You want to create a combo box that automatically completes what the user is typing based on the item list.


You can implement a basic autocomplete combo box by creating a custom control that overrides the OnKeyPress and OnTextChanged methods of the ComboBox object.

How It Works

An autocomplete control has many different variations. For example, the control may fill in values based on a list of recent selections (as Microsoft Excel does when you are entering cell values), or the control might display a drop-down list of near matches (as Microsoft Internet Explorer does when you are typing a URL). You can create a basic autocomplete combo box by handling the KeyPress and TextChanged events or ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.