VB.NET: Trigger Event inside Listbox

toytoy

Well-known member
Joined
Jul 16, 2004
Messages
46
Programming Experience
1-3
Does anyone know how to trigger the event inside the listbox when i double click on it....

Say when i double click on one of the items, it will bring me to another form...

Thanks
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
it wouldnt be a double click, but you can code the selectedindexchanged event for a listbox to take the user to another form
 

mzim

Well-known member
Joined
Jun 3, 2004
Messages
187
Location
Other side of the rock
Programming Experience
1-3
VB.NET:
 Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
 		Dim f As New Form2()
 		f.TextBox1.Text = ListBox1.SelectedItem
 		f.Show()
 	End Sub
 
Top Bottom