We’ll be covering the following topics in this tutorial:
ListBox present a list of choices that are displayed vertically in single column, if number of items exist the value can be displayed scrollbar automatically appear on control.
ListBox have list property contain list or item to display. To add the item at design time, click on list property & add item, press ctrl + enter after adding each item. To add item at runtime to AddItem method is used. Syntax is as following :
object.AddItem item, index
The item argument string that represents text to add to the list . The index argument is an integer than indicated when in list to add the new item.
A combobox control is combination of textbox and listbox. This control enables user to select either by typing in the text into combobox or by selecting items from the list.
The combobox controls has three different style that can be set .
a) Drop down combo (style 0)
b) Simple combo (style 1)
c) Drop down list (style 2)