remove button

novice:)

Member
Joined
Apr 23, 2010
Messages
5
Programming Experience
Beginner
ListBox1.Items.Remove(ListBox1.Text)
ListBox2.Items.Remove(ListBox2.Text)

i need so that i click the button once it deletes from both listboxes... for example a till... listbox1 had items listbox2 has prices .. to remove an item i want the price to go aswell with same click... any ideas?
i already have a clear all button.
 
You can use the SelectedIndex of one of the ListBox's with .Items.RemoveAt() for both. IE:

ListBox1.Items.RemoveAt(ListBox2.SelectedIndex)

Just make sure they're both synced.
 
Use the SelectedIndexChanged event of each ListBox to set the other's SelectedIndex to the same index
 
Back
Top