代码如下:
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBoxItem>Listitem 1</ListBoxItem>
<ListBoxItem>Listitem 2</ListBoxItem>
<ListBoxItem>Listitem 3</ListBoxItem>
<ListBoxItem>Listitem 4</ListBoxItem>
</ListBox>