Okay, here are the most usable functions of a listbox, to try this project, do the following:
- Make a new project
- Add a listbox-control
- Add three command-buttons
- Add this code:
Hitting the first button will ask you for any text which will be added as a row in the listbox. The second button will show you what's selected, if empty or if none selected it doesn't do anything. Third button will clear the listbox.Code:Private Sub Command1_Click() List1.AddItem InputBox("Type something", "New list item", "hello world") End Sub Private Sub Command2_Click() For x = 0 To List1.ListCount - 1 If List1.ListCount = 0 Then Exit For If List1.Selected(x) Then MsgBox "The data: " & List1.List(x) & " is selected." Exit For End If Next x End Sub Private Sub Command3_Click() List1.Clear End Sub
This should get your running...![]()




Reply With Quote