How to Change the Visibility of a WPF Grid
- 1). Open Visual Studio 2010.
- 2). Select "File," "New" and then "Project" and select WPF Application.
- 3). Click on the Toolbox, which is found on the right-hand side of the workspace. This panel displays all the different controls you can add to your WPF form.
- 4). Click and drag "Grid" from the Toolbox onto the MainWindow.Xaml workspace. A Grid control will appear on your workspace.
- 5). Click on the Grid control to give it focus.
- 6). Click on "Properties" on the right-hand side of the workspace. This panel displays all the configuration properties of the Grid control. Near the bottom is the property "Visibility".
- 7). Click "Visibility" in the Properties tab. There are three options: Visible, Hidden and Collapsed. Visible allows the program to display the grid, while both Hidden and Collapsed hide it from view. The difference between Hidden and Collapsed is that a Hidden grid takes up space on your application, resulting in an empty space. Collapsed does not take up this space, allowing other elements of your UI to fill in the spot where the grid would be.
- 8). Type "F5" to run the application and test the various visibility settings.
Source...