* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
2.6 KiB
title, ms.date, helpviewer_keywords, ms.assetid
| title | ms.date | helpviewer_keywords | ms.assetid | |
|---|---|---|---|---|
| How to: Make Sure That a GridSplitter Is Visible | 03/30/2017 |
|
0a62a964-89c8-48f0-9023-5df721a8cf47 |
How to: Make Sure That a GridSplitter Is Visible
This example shows how to make sure a xref:System.Windows.Controls.GridSplitter control is not hidden by the other controls in a xref:System.Windows.Controls.Grid.
Example
The xref:System.Windows.Controls.Panel.Children%2A of a xref:System.Windows.Controls.Grid control are rendered in the order that they are defined in markup or code. xref:System.Windows.Controls.GridSplitter controls can be hidden by other controls if you do not define them as the last elements in the xref:System.Windows.Controls.Panel.Children%2A collection or if you give other controls a higher xref:System.Windows.Controls.Panel.ZIndexProperty.
To prevent hidden xref:System.Windows.Controls.GridSplitter controls, do one of the following.
- Make sure that xref:System.Windows.Controls.GridSplitter controls are the last xref:System.Windows.Controls.Panel.Children%2A added to the xref:System.Windows.Controls.Grid. The following example shows the xref:System.Windows.Controls.GridSplitter as the last element in the xref:System.Windows.Controls.Panel.Children%2A collection of the xref:System.Windows.Controls.Grid.
[!code-xamlGridSplitterSnips#GridSplitterLastChild]
- Set the xref:System.Windows.Controls.Panel.ZIndexProperty on the xref:System.Windows.Controls.GridSplitter to be higher than a control that would otherwise hide it. The following example gives the xref:System.Windows.Controls.GridSplitter control a higher xref:System.Windows.Controls.Panel.ZIndexProperty than the xref:System.Windows.Controls.Button control.
[!code-xamlGridSplitterSnips#GridSplitterZIndex]
- Set margins on the control that would otherwise hide the xref:System.Windows.Controls.GridSplitter so that the xref:System.Windows.Controls.GridSplitter is exposed. The following example sets margins on a control that would otherwise overlay and hide the xref:System.Windows.Controls.GridSplitter.
[!code-xamlGridSplitterSnips#GridSplitterMargin]