Clickable Listbox Item?

Sc0pe

Newcomer
Joined
Oct 15, 2004
Messages
24
I'm wondering how you have an action in a listbox item. When you click the item in the listbox it does something...

What I have so far....


Visual Basic:
ListBox4.Items.Item(9)
 
Sc0pe said:
I'm wondering how you have an action in a listbox item. When you click the item in the listbox it does something...

What I have so far....


Visual Basic:
ListBox4.Items.Item(9)

look for it in the listbox events....
 
Are you looking for something like this?

Visual Basic:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
   If ListBox1.SelectedItem = "actionItem" Then
     'blah
   End If
End Sub

or you can use its selected index integer value
 
DiverDan said:
Are you looking for something like this?

Visual Basic:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
   If ListBox1.SelectedItem = "actionItem" Then
     'blah
   End If
End Sub

or you can use its selected index integer value


Thanks, that worked great. :D
 
Back
Top