(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 |
=========================================================================
No comments:
Post a Comment