forked from microsoft/WPF-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.cs
36 lines (31 loc) · 1.12 KB
/
MainWindow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// // Copyright (c) Microsoft. All rights reserved.
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Windows;
namespace VisibiltyChanges
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void ContentVis(object sender, RoutedEventArgs e)
{
tb1.Visibility = Visibility.Visible;
txt1.Text = "Visibility is now set to Visible.";
}
private void ContentHid(object sender, RoutedEventArgs e)
{
tb1.Visibility = Visibility.Hidden;
txt1.Text = "Visibility is now set to Hidden. Notice that the TextBox still occupies layout space.";
}
private void ContentCol(object sender, RoutedEventArgs e)
{
tb1.Visibility = Visibility.Collapsed;
txt1.Text = "Visibility is now set to Collapsed. Notice that the TextBox no longer occupies layout space.";
}
}
}