combo box

18
Electroteam__@hotm ail.com Interesting Interesting Education Education Electro-Team

Upload: it-big-dig

Post on 17-Dec-2014

277 views

Category:

Education


4 download

DESCRIPTION

visual basic 2010 combobox tool

TRANSCRIPT

Page 1: Combo box

[email protected]

Interesting Interesting

EducationEducationElectro-Team

Page 2: Combo box

ComboBox

A ComboBox control is a combination of a TextBox and a ListBox control

Page 3: Combo box

Open new project

Page 4: Combo box

Add ComboBox \ Item property \ press ... Button \ type White, Red, Black & Yellow

Add items from Design window

Page 5: Combo box

Run Time

Page 6: Combo box

You can add same items at run-time

Another method for adding items

Add items by Code

Page 7: Combo box

Add 1 Button and Fix it

Page 8: Combo box

Run Time

Page 9: Combo box

Sb could be anything else like X, Y or Z

Page 10: Combo box

Add another Button and Fix it

Page 11: Combo box

Run Time

Page 12: Combo box

Double click on Button2 and type yellow phrase

Page 13: Combo box

Add GroupBox, Button and TextBox

Page 14: Combo box

Run Time

TextBox Will have the same value as ComboBox

Page 15: Combo box
Page 16: Combo box

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

Page 17: Combo box
Page 18: Combo box

Produced by

Electro-Team

[email protected]