在wpf中,关于ListBox里CheckBox横向排列

来源:互联网 发布:wap网站源码 编辑:程序博客网 时间:2024/05/18 02:46
       <ListBox x:Name="listMember" Height="30" Margin="0"  ItemsSource="{Binding }"  Grid.Row="3" Grid.Column="1"   ScrollViewer.VerticalScrollBarVisibility="Disabled">                        <ListBox.Template>                            <ControlTemplate TargetType="{x:Type ListBox}">                                <WrapPanel Orientation="Horizontal" IsItemsHost="True"/>                            </ControlTemplate>                        </ListBox.Template>                        <ListBox.ItemTemplate>                            <DataTemplate>                                <CheckBox   Content="{Binding Name}" IsChecked="{Binding IsSelected}"   Height="30" Width="60"  >                                </CheckBox>                            </DataTemplate>                        </ListBox.ItemTemplate>                    </ListBox>


 

0 0