#959 – ListBox Basics

You can use a ListBox control to allow a user to select one or more items from a larger list of items.  The ListBox displays some subset of the items, with additional items visible by using scrollbars.

959-001

 

You typically populate a ListBox using data binding, setting its ItemsSource property.  Optionally, you can use the DisplayMemberPath property to indicate which property on the bound items is to be used in generating the text within the ListBox.

The Items property of the ListBox contains a collection of the items displayed in the list.  You typically use the SelectedItemSelectedItems, or SelectedIndex properties to access one or more items that a user has selected.

Instead of simple strings, each item in the ListBox can instead be displayed as a more complex user interface element.

959-002

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

3 Responses to #959 – ListBox Basics

  1. Pingback: Dew Drop – November 27, 2013 (#1673) | Morning Dew

  2. Pingback: #964 – ListBox Data Binding Basics, Part I | 2,000 Things You Should Know About WPF

  3. Pingback: #1,008 – ComboBox Basics | 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: