SelectionMode Property
Collapse the table of content
Expand the table of content

ListBox.SelectionMode Property

 

Gets or sets the selection behavior for a ListBox.

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

member SelectionMode : SelectionMode with get, set

Property Value

Type: System.Windows.Controls.SelectionMode

One of the SelectionMode values. The default is Single selection.

Identifier field

SelectionModeProperty

Metadata properties set to true

None

The following example sets the SelectionMode property to Multiple.

<ListBox SelectionMode="Multiple">
  <DockPanel>
    <Image Source="data\cat.png"/>
    <TextBlock>CAT</TextBlock>
  </DockPanel>
  <DockPanel>
    <Image Source="data\dog.png"/>
    <TextBlock>DOG</TextBlock>
  </DockPanel>
  <DockPanel>
    <Image Source="data\fish.png"/>
    <TextBlock>FISH</TextBlock>
  </DockPanel>
</ListBox>

.NET Framework
Available since 3.0
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft