WP7 Prevent ListBox scrolling

后端 未结 1 2034
醉梦人生
醉梦人生 2021-01-17 09:43

I have a page with two ListBox controls. The page contains a list of items based on the item\'s category.

There is a header for a category, followed by a ListBox co

相关标签:
1条回答
  • 2021-01-17 10:39

    All you have to do in order to disable the scroll is just to set ScrollViewer.VerticalScrollBarVisibility="Disabled" (if you need to disable the horizontal scroll then use ScrollViewer.HorizontalScrollBarVisibility="Disabled").

    Here is a simple example:

    <ListBox Height="200" ScrollViewer.VerticalScrollBarVisibility="Disabled">
        <ListBoxItem >
            <Button Content="item1"  />
        </ListBoxItem>
        <ListBoxItem >
            <Button Content="item2"  />
        </ListBoxItem>
        <ListBoxItem >
            <Button Content="item3"  />
        </ListBoxItem>
        <ListBoxItem >
            <Button Content="item4"  />
        </ListBoxItem>
        <ListBoxItem >
            <Button Content="item5"  />
        </ListBoxItem>
    </ListBox>
    

    I hope that this will answer your question.

    0 讨论(0)
提交回复
热议问题