Damn listbox Madness (-please help me-)
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
Hi i have to listboxes laid out like so
Richard Richard
Tom Tom
and so on all i want is if you click a name in one it will click it in the other i tried this code
Richard Richard
Tom Tom
and so on all i want is if you click a name in one it will click it in the other i tried this code
Code: Select all
and it does nothing only click staright to the top one and then dies wont work again wont do anything just stays their any ideas on how to change this so it will work please people Private Sub ListBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick
ListBox1.SelectedIndex = sender.Tag
End Sub
Try
Code: Select all
Private Sub ListBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick
ListBox1.SelectedItem = CType(sender, ListBox).SelectedItem
End Sub
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
that didnt work but i changed it to
Private Sub ListBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick
ListBox1.SelectedIndex = CType(sender, ListBox).SelectedIndex
End Sub
and works great thanks Codenstuff
Private Sub ListBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick
ListBox1.SelectedIndex = CType(sender, ListBox).SelectedIndex
End Sub
and works great thanks Codenstuff
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023