Updated: February 2009
Represents the control that redistributes space between columns or rows of a Grid control.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
The control redistributes space between rows or columns in a Grid, without changing the dimensions of the Grid. For example, when a resizes two columns, the ActualWidth property of one column is increased while at the same time the ActualWidth property of the other column is decreased by the same amount.
The following table shows how to define a horizontal or vertical by setting the HorizontalAlignment and VerticalAlignment properties and by leaving the ResizeDirection and ResizeBehavior properties set to their default values.
How to create vertical and horizontal GridSplitter controls
A can overlap a row or column that contains other content, or it can occupy a row or column by itself. For more information about how to define a , see How to: Resize Rows with a GridSplitter and How to: Resize Columns with a GridSplitter.
A may be obscured by other objects that are contained in the Children collection of the Grid. For information about how to prevent this situation, see How to: Make Sure That a GridSplitter Is Visible.
Dependency properties for this control might be set by the control’s default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see Themes.
The following example shows how to define a that resizes columns in a Grid by overlaying the edge of a column.
GridSplitter mySimpleGridSplitter = new GridSplitter(); Grid.SetColumn(mySimpleGridSplitter, 0); mySimpleGridSplitter.Background = Brushes.Blue; mySimpleGridSplitter.HorizontalAlignment = HorizontalAlignment.Right; mySimpleGridSplitter.VerticalAlignment = VerticalAlignment.Stretch; mySimpleGridSplitter.Width = 5;
|How to: Resize Rows with a GridSplitter||This example shows how to use a horizontal to redistribute the space between two rows in a Grid without changing the dimensions of the Grid.|
|How to: Resize Columns with a GridSplitter||This example shows how to create a vertical in order to redistribute the space between two columns in a Grid without changing the dimensions of the Grid.|
|How to: Make Sure That a GridSplitter Is Visible||This example shows how to make sure a control is not hidden by the other controls in a Grid.|
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.