SelectionMode Enumeration

Defines the selection behavior for a ListBox.

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

public enum SelectionMode
public enum SelectionMode
public enum SelectionMode
<object property="EnumerationValue" .../>

 Member nameDescription
ExtendedThe user can select multiple consecutive items while holding down the SHIFT key.  
MultipleThe user can select multiple items without holding down a modifier key. 
SingleThe user can select only one item at a time.  

Set the SelectionMode property to one of the SelectionMode values to specify whether the user can select more that one item in a list box.

This example shows how to set the selection modes for ListBox. The SelectionMode property indicates how many ListBoxItem elements a user can select at one time. You can set this property to Single (the default value), Multiple, or Extended. The following example shows how to create a ListBox where users can select more than one item (Multiple selections).

<ListBox SelectionMode="Multiple">
    <Image Source="data\cat.png"/>
    <Image Source="data\dog.png"/>
    <Image Source="data\fish.png"/>

For the complete sample, see List Box Sample.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0