UIElement.IsVisible 屬性


取得值,表示這個項目在 使用者介面 (UI)user interface (UI) 中是否可見。Gets a value indicating whether this element is visible in the 使用者介面 (UI)user interface (UI). 這是相依性屬性。This is a dependency property.

 property bool IsVisible { bool get(); };
public bool IsVisible { get; }
member this.IsVisible : bool
Public ReadOnly Property IsVisible As Boolean



如果項目可見,則為 true;否則為 falsetrue if the element is visible; otherwise, false.


判斷 IsVisible 值會將版面配置的所有因素都納入考慮。Determination of the IsVisible value takes all factors of layout into account. 相反地, Visibility 這是可設定的屬性,只會指出以程式設計方式讓元素變成可見或隱藏的意圖。In contrast, Visibility, which is a settable property, only indicates the intention to programmatically make an element visible or invisible.

IsVisible false 參與輸入事件 (或命令) 的專案,不會影響版面配置的量值或排列行程、無法獲得焦點、不在定位順序中,也不會在點擊測試中報告。Elements where IsVisible is false do not participate in input events (or commands), do not influence either the measure or arrange passes of layout, are not focusable, are not in a tab sequence, and will not be reported in hit testing. 相反地,在中的專案 IsEnabled false 仍會參與事件和命令,並進行點擊測試,但也不能成為焦點。In contrast, elements where IsEnabled is false will still participate in events and commands, and hit testing, but are also not focusable.

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field IsVisibleProperty
中繼資料屬性設定為 trueMetadata properties set to true NoneNone