I would like to have an interface with 3 components one next to the other. The first would be a ListView and the two others being Grids.
Since the components will overflow on the right, I want to put them in a ScrollViewer. I did not succeed. I tried to do a really simple example to try, but even the example fails.
<ScrollViewer Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="400">
<StackPanel Width="1200" Height="400" Orientation="Horizontal">
<Border Background="AntiqueWhite" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="Blue" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="LimeGreen" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
</StackPanel>
</ScrollViewer>
As you can see, the ScrollViewer is Inside a Grid. What did I miss?
Try settings these properties on the scroll viewer:-
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" ZoomMode="Disabled" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="400">
<StackPanel Width="1200" Height="400" Orientation="Horizontal">
<Border Background="AntiqueWhite" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="Blue" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
<Border Background="LimeGreen" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" />
</StackPanel>
</ScrollViewer>
That works for me normally!
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