SelectionMode Enumeration
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
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"> <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>
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.