How can I get ScrollViewer to work inside a StackPanel?
You can’t without fixing the height of the StackPanel. It’s designed to grow indefinitely in one direction. I’d advise using a different Panel. Why do you “need” to have an outer StackPanel?
You can’t without fixing the height of the StackPanel. It’s designed to grow indefinitely in one direction. I’d advise using a different Panel. Why do you “need” to have an outer StackPanel?
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. <ListBox ItemsSource=”{Binding}” ScrollViewer.VerticalScrollBarVisibility=”Visible”> </ListBox> Setting this value to Auto will popup the scrollbar on an as needed … Read more
To get a scrollbar for an ItemsControl, you can host it in a ScrollViewer like this: <ScrollViewer VerticalScrollBarVisibility=”Auto”> <ItemsControl> <uc:UcSpeler /> <uc:UcSpeler /> <uc:UcSpeler /> <uc:UcSpeler /> <uc:UcSpeler /> </ItemsControl> </ScrollViewer>