VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



code to add items in a list box from text box and to report the user when listbox is empty on remov

by chandra mohan (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 11th May 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



 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


Download this snippet    Add to My Saved Code

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 have been posted about code to add items in a list box from text box and to report the user when listbox is empty on remov. Why not be the first to post a comment about code to add items in a list box from text box and to report the user when listbox is empty on remov.

Post your comment

Subject:
Message:
0/1000 characters