UIElement.IsHitTestVisible UIElement.IsHitTestVisible UIElement.IsHitTestVisible UIElement.IsHitTestVisible Property

定義

取得或設定宣告此元素是否可以從其呈現內容的某些部分傳回,作為點擊測試結果的值。Gets or sets a value that declares whether this element can possibly be returned as a hit test result from some portion of its rendered content. 這是相依性屬性。This is a dependency property.

public:
 property bool IsHitTestVisible { bool get(); void set(bool value); };
public bool IsHitTestVisible { get; set; }
member this.IsHitTestVisible : bool with get, set
Public Property IsHitTestVisible As Boolean

屬性值

如果無法從至少一個點將這個項目作為點擊測試結果傳回,則為 true;否則為 falsetrue if this element could be returned as a hit test result from at least one point; otherwise, false. 預設值為 trueThe default value is true.

備註

點擊測試的項目邏輯樹狀結構中的相對位置會影響這個屬性的有效值。The effective value of this property is influenced by the relative positions of hit testable elements in the logical tree. 比方說,如果某個元素的子元素的項目,不進行點擊測試顯示,有效子系上的屬性值將會維持false,即使試圖將該值設為在本機。For instance, if an element is a child element of an element that is not hit test visible, the effective value of the property on the child will remain false, even if attempting to set that value locally. 基於這個理由,是很重要,您未設定IsHitTestVisiblefalse複合控制項上,除非您不想要的任何輸入或點擊測試的控制項。For this reason, it is important that you do not set IsHitTestVisible to false on a composited control unless you do not want any input or hit testing on that control. 如需點擊測試的詳細資訊,請參閱視覺分層中的點擊測試For more information on hit testing, see Hit Testing in the Visual Layer.

相依性屬性資訊Dependency Property Information

識別項欄位Identifier field IsHitTestVisibleProperty
若要設定的中繼資料屬性 trueMetadata properties set to true None

適用於

另請參閱