WPF实现ListBox实现多列自定义内容显示
WPF实现ListBox实现多列自定义列显示
上代码:ListBox多列自动换行的前端XAML实现代码 很简单
<ListBox MaxHeight="100" Name="ColourGamutList"
ItemsSource="{Binding}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<!--内容区域-->
<Label Width="90" Content="自定义内容" />
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>