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

VB ComboBox

Nov 03, 2014

Download

Documents

Mohamad Saad

Visual Basic 2010
Combo box tutorial
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: VB ComboBox

[email protected]

Interesting Interesting

EducationEducationElectro-Team

Page 2: VB ComboBox

ComboBox

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

Page 3: VB ComboBox

Open new project

Page 4: VB ComboBox

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

Add items from Design window

Page 5: VB ComboBox

Run Time

Page 6: VB ComboBox

You can add same items at run-time

Another method for adding items

Add items by Code

Page 7: VB ComboBox

Add 1 Button and Fix it

Page 8: VB ComboBox

Run Time

Page 9: VB ComboBox

Sb could be anything else like X, Y or Z

Page 10: VB ComboBox

Add another Button and Fix it

Page 11: VB ComboBox

Run Time

Page 12: VB ComboBox

Double click on Button2 and type yellow phrase

Page 13: VB ComboBox

Add GroupBox, Button and TextBox

Page 14: VB ComboBox

Run Time

TextBox Will have the same value as ComboBox

Page 15: VB ComboBox
Page 16: VB 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

Page 17: VB ComboBox
Page 18: VB ComboBox

Produced by

Electro-Team

[email protected]