ListBox
Introduction
The ListBox control provides a scrollable list of ListBoxItems for displaying and selecting from a list.
Code Example: Adding a ListBox
The following code adds items to a ListBox when a button is clicked. When an item is added, ScrollIntoView
is called so the item is shown.
Selection
ListBox items can be selected. The ListBox class provides a number of ways to work with the selection.
Selection can be set by index:
Item can also be selected by the reference itself, assuming the referenced item is part of the list box:
Whenever the selection changes, the SelectionChanged event is raised:
Last updated