I am trying to get a scroll bar to be placed on a stack panel. The scroll bar displays but will not allow for the user to move the scroll bar at all. Is there something wrong with my XMAL or is there more to it?
<GroupBox HorizontalAlignment="Left" Margin="268,8,0,0" VerticalAlignment="Top" Width="505.881" Height="352.653" Header="Metrics">
<Grid>
<ScrollViewer>
<StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</GroupBox>
The content of the stack panel is expanders with data contained with in them.
You must not set the Width and Height of the GroupBox in order to make the inner ScrollViewer work. Try this out and you'll see that it will work fine.
<GroupBox Header="Metrics" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="268,8,0,0">
<Grid>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<StackPanel>
<Expander Header="Expander">
<StackPanel>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
<Button>Test</Button>
</StackPanel>
</Expander>
</StackPanel>
</ScrollViewer>
</Grid>
</GroupBox>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With