- Home
·
- Miscellaneous
·
- code to add items in a list box from text box and to report the user when listbox is empty on remov
code to add items in a list box from text box and to report the user when listbox is empty on remov
code to add items in a list box from text box and to report the user when listbox is empty on removal
API Declarations
create 2 command button and 1 list box and 1 text box
set the properties accordingly
command1 name-cmd1 caption-add
command2 name-cmd2 caption-clear
textbox name-textadd
listbox name-showlist
Rate code to add items in a list box from text box and to report the user when listbox is empty on remov
(1(1 Vote))
showlist.AddItem (txtadd.Text)
txtadd.Text = ""
End Sub
Private Sub cmd2_Click()
showlist.RemoveItem (0)
If (showlist.ListCount = 0) Then
MsgBox "listbox is empty"
' to remove all items from list box
'add this line showlist.clear
End If
End Sub
code to add items in a list box from text box and to report the user when listbox is empty on remov Comments
No comments yet — be the first to post one!
Post a Comment