NineCooL

Telent ain't cheap, Knowledge can't be sold..

Tuesday, March 21, 2006

CombBox Control on Visual Basic 6

OK,this post may be a joke to most VB programmers but, one of my friends ask me this question, so I though to post it in here so others who have the same problem this will help.


Fill a ComboBox with items.

Private Sub Form_Load ()
   Combo1.AddItem "Chardonnay"
   Combo1.AddItem "Fum Blanc"
   Combo1.AddItem "Gewrztraminer"
   Combo1.AddItem "Zinfandel"
End Sub

Clear the ComboBox

Private Sub cmdClear_Click ()
   Combo1.Clear
End Sub


Remove a Specific Item

Syntax : ControlName.RemoveItem index

Example : Combo1.RemoveItem 2

Above line removes 3rd item in the Combo1 Control.

Access to a specific Item
if you waant to access to a specific item in the ComboBox, you can use
following method to do so.

Text1.Text = Combo1.List(2)

above line will copy the 3rd Item text in ot the TextBox.

so I'll stop from here. please use comments, if you have any problems.




0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home