This article is based on the following MSDN documents:
- Walkthrough: Creating a Resizable Application by Using the WPF Designer
- How to: Create User-Resizable Applications with GridSplitter
- How to: Resize Rows with a GridSplitter
- How to: Resize Columns with a GridSplitter
- How to: Make Sure That a GridSplitter Is Visible
Resize Rows with a GridSplitter:
Set the VerticalAlignment to Top or Bottom (which alignment you set depends on which two rows you want to resize). Then, set the HorizontalAlignment property to Stretch.
How to create a GridSplitter that overlays the edge of a row: set the ColumnSpan attached property to specify the number of columns.
How to create a GridSplitter that occupies a row: set the VerticalAlignment to Center, set the HorizontalAlignment property to Stretch, and set the Height of the row that contains the GridSplitter to Auto.
How to prevent a row's height been resize to 0: set the MinHeight property of the row to a value so that the controls in the row will always be visible.
Resize Columns with a GridSplitter:
Set the HorizontalAlignment property to Left or Right (which alignment you set depends on which two columns you want to resize). Then, set the VerticalAlignment property to Stretch.
How to create a GridSplitter that overlays the edge of a column: set the RowSpan attached property to the number of rows.
How to create a GridSplitter that occupies a column: set the HorizontalAlignment to Center, set the VerticalAlignment property to Stretch, and set the Width of the column that contains the GridSplitter to Auto.
How to prevent a column's width been resize to 0: set the MinWidth property of the row to a value so that the controls in the row will always be visible.
Make Sure That a GridSplitter Is Visible:
- Set the ZIndexProperty on the GridSplitter to be higher than a control that would otherwise hide it.
- Set margins on the control that would otherwise hide the GridSplitter so that the GridSplitter is exposed.
Go ahead and take a look at all of the links that I've shown you. There are examples will help you a lot more understanding on what I wrote.
No comments:
Post a Comment