Working with ListBox?

vbextreme

Newcomer
Joined
Oct 13, 2004
Messages
4
I would like to know the code for when a user clicks on a specific name/data in the list Box, it will display the information of the clicked item!

for example

list1.additem(text1.text) 'Add the item to the list
 
vbextreme said:
I would like to know the code for when a user clicks on a specific name/data in the list Box, it will display the information of the clicked item!
for example list1.additem(text1.text) 'Add the item to the list

You can do something like this, this is for doubleclicking but there is one for single clicking
Code:
 Private Sub list1_doubleclick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles list.DoubleClick
        textbox1.text = Me.list1.SelectedItem
End If
 
Uhmmm... kk

Here is an example of what i need

Private Sub cmdInfor_Click()
list1.AddItem (text1.Text)
If list1.Selected("ANYTHING") Then
form2.Show 'This form has the information of ANYTHING
Else
Dim msg, variable, title, response
msg = "You have not selected anything from the list"
variable = vbOKOnly
title = "Error"
response = MsgBox(msg, variable, title)
End Sub
 
Back
Top