WPF下Listbox水平排列并平滑滚动

来源:互联网 发布:enroute3破解软件下载 编辑:程序博客网 时间:2024/06/02 01:11

  <ListBox Margin="238,205,248,0" Name="listBox1" Height="58" VerticalAlignment="Top" ScrollViewer.CanContentScroll="False">
            <ListBox.ItemsPanel>               
                <ItemsPanelTemplate>                   
                    <VirtualizingStackPanel Orientation="Horizontal"></VirtualizingStackPanel>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBoxItem>这是1哈哈哈哈...........</ListBoxItem>
            <ListBoxItem>这是二哈哈哈哈...........</ListBoxItem>
            <ListBoxItem>这是三哈哈哈哈...........</ListBoxItem>
        </ListBox>

 

CanContentScroll=“False" 表示平滑滚动,如果为True,则为按项滚动。

原创粉丝点击