[email protected]
Electro-TeamInteresting Education
ComboBox
A ComboBox control is a combination of a TextBox and a ListBox control
Add ComboBox \ Item property \ press ... Button \ type White, Red, Black & Yellow
Add items from Design window
You can add same items at run-time
Another method for adding items
Add items by Code
Add 1 Button and Fix it
Sb could be anything else like X, Y or Z
Add another Button and Fix it
Double click on Button2 and type yellow phrase
Add GroupBox, Button and TextBox
Run Time
TextBox Will have the same value as ComboBox
Error
If there is no selected item ComboBox1.SelectedIndex will be
-1 and this will produce an Error
ComboBox1.Items
White
Red
Black
yellow
ComboBox1.SelectedIndex
0
1
2
3
Dim X As String =ComboBox1.Items(ComboBox1.SelectedIndex) TextBox1.Text = X
The End
Produced by
Electro-Team