Click here to Skip to main content
15,878,959 members
Articles / Desktop Programming / Windows Forms
Article

Look-up ComboBox

Rate me:
Please Sign up or sign in to vote.
4.70/5 (22 votes)
5 May 20051 min read 128.8K   5.2K   62   11
The article contains LookupComboBox control.

Image 1

Introduction

.NET Framework 1.1 has a wide variety of visual components available for Windows Forms applications. Anyhow there is no ComboBox component with the possibility of look-up data defined in the Items property (or bound DataSource) of ComboBox. This article describes a look-up ComboBox with the ability to find an appropriate item in ComboBox items.

Features

The main good feature of the ComboBox is that the ComboBox has a property AllowTypeAllSymbols. If the property is true you can type any symbols in the ComboBox textbox. The items will be selected according to the first correctly entered symbol. For example, if the ComboBox holds "Item 1", "Item 2", "Test 1", "Test 2", "Combo", "Box" and if you enter "it", Item 1 will be selected. Again, if you enter "itm", "Item 1" will be selected. This way you can continue to enter any amount of symbols.

If AllTypeAllSymbols is false, you will be able to enter only those symbols, that are defined in the string of Items (or bound DateSource) property. For this example you will be able to enter only i, t, c, b as a first symbol. If you enter "i" as a first symbol - "Item 1" will be automatically selected, the second symbol can only be "t", you will not be able to enter any other symbol. "Item 2" will be selected only if you type the whole string "Item 2". The demo application shows this functionality.

Using the code

You can just add lookupcombobbox.dll to your project and use it for any Windows Forms application.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 2 Pin
imamul.karim25-Nov-10 0:51
imamul.karim25-Nov-10 0:51 
GeneralComponent not Visible Pin
pcjd631-Dec-07 4:04
pcjd631-Dec-07 4:04 
GeneralAnother Bug Pin
Sebastian P.R. Gingter26-Jun-07 23:37
Sebastian P.R. Gingter26-Jun-07 23:37 
GeneralNew Bug Pin
Christopher Stratmann12-Feb-07 5:58
Christopher Stratmann12-Feb-07 5:58 
GeneralQuestion. Pin
lishe23-Nov-06 20:43
lishe23-Nov-06 20:43 
GeneralRe: Question. Pin
Ray Guan8-May-07 22:52
Ray Guan8-May-07 22:52 
QuestionPossible Bug? Pin
bmcneill028-Jun-06 20:43
bmcneill028-Jun-06 20:43 
GeneralAdditional bug found Pin
briannacd7-Jun-05 4:40
briannacd7-Jun-05 4:40 
GeneralBug Pin
Josef Meile2-May-05 0:10
Josef Meile2-May-05 0:10 
GeneralRe: Bug Pin
Josef Meile2-May-05 2:28
Josef Meile2-May-05 2:28 
GeneralRe: Bug Pin
dotNet Toys4-May-05 22:18
dotNet Toys4-May-05 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.