1、ListBox横向排列:
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation=”Horizontal” IsItemsHost=”True”/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
2、ListBox横向排列 + 自动换行:
<ListBox>
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<WrapPanel Orientation="Horizontal" IsItemsHost="True" ScrollViewer.CanContentScroll="True"/>
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
</ListBox>
转载:https://blog.csdn.net/chenghui2006/article/details/77980549