Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
0 out of 1 rated this helpful - Rate this topic

UIElement::Visibility Property

Gets or sets the user interface (UI) visibility of this element. This is a dependency property.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[LocalizabilityAttribute(LocalizationCategory::None, Readability = Readability::Unreadable)]
public:
property Visibility Visibility {
	Visibility get ();
	void set (Visibility value);
}
<object Visibility="Visibility" .../>

Property Value

Type: System.Windows::Visibility
A value of the enumeration. The default value is Visible.

Identifier field

VisibilityProperty

Metadata properties set to true

None

Setting this property affects the value of IsVisible, which in turn may raise the IsVisibleChanged event. However, IsVisible has other factors that influence it, for instance the visibility settings of parents that contain it.

Elements where Visibility is not Visible do not participate in input events (or commands), do not influence either the Measure or Arrange passes of layout, are not in a tab sequence, and will not be reported in hit testing.

When inherited by Window or its derived classes, Window redefines the default value of this property to be Collapsed. This has the effect of not running the Measure pass of layout on an initially created Window, and RenderSize returns (0,0). For details, see Window. Popup also redefines the default value to be Collapsed, with similar resulting behavior for Popup and its derived classes.

The following example implements a handler that references two different named buttons that are intended to be a mutually exclusive pair in the user interface. Prior to running the actual program logic associated with the button, the button itself is set to be Visibility::Hidden, and the other button in the pair is set to Visibility::Visible.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

Show:
© 2014 Microsoft. All rights reserved.