Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Sunday, June 5, 2011

VB-21 : Selecting items from a listbox/Combobox (Through Program)



Our selected item will store in the list index of combo box.
     
A)   Property :
ComboBox : NAME- Combo1,TEXT-(Blank)
Textbox : NAME-Text1,Text- (Blank)
CommandButton-NAME- Command1,Caption-Add
CommandButton-NAME- Command3,Caption-Select






     B)   Attaching Code to the Object :
  
    
Private Sub Command1_Click()
Combo1.AddItem Text1.Text
End Sub

Private Sub Command3_Click()
st = Combo1.List(Combo1.ListIndex)

MsgBox (st)
End Sub




=========================================================================
Back to Home   &  VB

No comments: