Answer the question
In order to leave comments, you need to log in
How to implement the same selection in two ListBoxes?
Good afternoon. I have two listboxes on a form with the same number of rows. 10 in one and 10 in the other.
How to make it so that, say, selecting the 8th element in the first Listbox, the 8th element in the second Listbox is automatically selected? The use of if () came to mind, but with a large number of elements, a very long piece comes out.
Answer the question
In order to leave comments, you need to log in
Subscribe to the SelectedChanged event like this is called and in it at the second sheet do this:
list2.SelectedIndex = list1.SelectedIndex;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question