IsSelected Property
Collapse the table of content
Expand the table of content

ListBoxItem.IsSelected Property


Gets or sets a value that indicates whether a ListBoxItem is selected.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public bool IsSelected { get; set; }

Property Value

Type: System.Boolean

true if the item is selected; otherwise, false. The default is false.

To select a ListBoxItem in a ListBox, set this property to true.

Identifier field


Metadata properties set to true


The following example shows how to set a list box item to be selected when the list box is created.

<ListBoxItem Name="item0" IsSelected="true">Item 0</ListBoxItem>

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft