ui
<StackPanel Margin="5">
<Border x:Name="bd1">
<TextBlock Name="tb1" Text="123" />
</Border>
<Button
x:Name="btn1"
Click="btn1_Click"
Content="隐藏Border" />
</StackPanel>
后台代码
private void btn1_Click(object sender, RoutedEventArgs e)
{
bd1.Visibility = Visibility.Hidden;
Console.WriteLine(tb1.Visibility); //Visible
Console.WriteLine(tb1.IsVisible); //False
}
标签:Console,tb1,Visibility,WriteLine,IsVisible,wpf
From: https://www.cnblogs.com/trykle/p/17467441.html