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-19 : Adding items in a listbox/Combobox (Through Program)


(A)        When we click the add button, “Hello “will add to the list as per our click.


     A)   Property :
Listbox  : NAME-List1,LIST-(Blank)
CommandButton-NAME- Command1,Caption-Add





     B)   Attaching Code to the Object :

Private Sub Command1_Click()
List1.AddItem”Hello”
End Sub



=========================================================================
(B)        If we want to add items to the listbox as per our choice, then follow the code given below:

     A)   Property :

Listbox  : NAME-List1,LIST-(Blank)
Textbox : NAME-Text1,Text- (Blank)
CommandButton-NAME- Command1,Caption-Add



     B)   Attaching Code to the Object :


Private Sub Command1_Click()
List1.AddItem Text1.Text
End Sub



=========================================================================

C) . Adding items in a ComboBox(Through Program)

     A)   Property :

ComboBox : NAME- Combo1,TEXT-(Blank)
Textbox : NAME-Text1,Text- (Blank)
CommandButton-NAME- Command1,Caption-Add




     B)   Attaching Code to the Object :


Private Sub Command1_Click()
Combo1.AddItem Text1.Text
End Sub



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

No comments: