내보내기(0) 인쇄
모두 확장

UIElement.Visibility 속성

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

네임스페이스: System.Windows
어셈블리: PresentationCore(presentationcore.dll)
XML 네임스페이스:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)] 
public Visibility Visibility { get; set; }
/** @property */
public Visibility get_Visibility ()

/** @property */
public void set_Visibility (Visibility value)

public function get Visibility () : Visibility

public function set Visibility (value : Visibility)

<object Visibility="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.

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.

public void PlayMedia(object sender, MouseButtonEventArgs args)
{
    pauseBTN.Visibility = Visibility.Visible;
    playBTN.Visibility = Visibility.Collapsed;

    media.SpeedRatio = 1.0;
    media.Play();
}

Microsoft .NET Framework 3.0은 Windows Vista, Microsoft Windows XP SP2 및 Windows Server 2003 SP1에서 지원됩니다.

.NET Framework

3.0에서 지원

커뮤니티 추가 항목

추가
Microsoft는 MSDN 웹 사이트에 대한 귀하의 의견을 이해하기 위해 온라인 설문 조사를 진행하고 있습니다. 참여하도록 선택하시면 MSDN 웹 사이트에서 나가실 때 온라인 설문 조사가 표시됩니다.

참여하시겠습니까?
표시:
© 2014 Microsoft