How can I get a vertical scrollbar in my ListBox?

后端 未结 7 1509
执念已碎
执念已碎 2020-12-13 16:55

In the example below I have a ListBox with dozens of font names in it.

I would have thought it would automatically have a vertical scrollbar on it so that you can se

7条回答
  •  囚心锁ツ
    2020-12-13 17:41

    The problem with your solution is you're putting a scrollbar around a ListBox where you probably want to put it inside the ListBox.

    If you want to force a scrollbar in your ListBox, use the ScrollBar.VerticalScrollBarVisibility attached property.

    
    
    

    Setting this value to Auto will popup the scrollbar on an as needed basis.

提交回复
热议问题