原文:
WPF中ListBox控件选择多个数据项
XAML:
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <StackPanel> <TextBlock>在控件中一次选择多个数据项:</TextBlock> <ListBox SelectionMode="Multiple"> <ListBoxItem>a</ListBoxItem> <ListBoxItem>b