O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Use an Auto-Complete Combo Box

Problem

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

Solution

You can implement a basic auto-complete combo box by handling the KeyPress event.

Discussion

Many professional applications include some type of auto-complete control. This control might fill in values based on a list of recent selections (as Microsoft Excel does when entering cell values) or might display a drop-down list of near matches (as Internet Explorer does when typing a URL). You can create a basic auto-complete combo box by handling the KeyPress and TextChanged events, searching for matching items in the appropriate list, and then filling in the appropriate item. The important step is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required