Wpf control overlaps?

I have a Dockpanel on which there are two buttons (left and right sides) and a scrollviewer at the bottom. Can I hide the left and right sides of this scrollviewer under these buttons?

+4
source share
1 answer

You can use the Grid instead of the DockPanel either use alignments or create columns and edit ColumnSpan , an example of the latter:

 <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition /> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <!-- Order matters, earlier controls are at the bottom unless you use Panel.ZIndex --> <ScrollViewer Grid.Column="0" Grid.ColumnSpan="3"/> <Button Grid.Column="0" Content="Left"/> <Button Grid.Column="2" Content="Right"/> </Grid> 

(DockPanel is a pretty poor control that can be easily replaced with a grid in just about every case)

+6
source

Source: https://habr.com/ru/post/1380542/


All Articles