我想在列表框中显示多列。我参考了以下链接Using WrapPanel and ScrollViewer to give a multi-column Listbox in WPF。
问题:
我想使用重复按钮滚动内容。如何使用按钮控制列表框滚动条。
代码:
<ListBox Name="lbTrack" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemsSource="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock FontSize="14" Margin="10" Text="{Binding TrackName}" /> </StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Vertical"></WrapPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>