Wednesday, January 25, 2012

GridSplitter in WPF

This article is based on the following MSDN documents:

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:

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