ContextMenu.IsOpen 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,指示是否 ContextMenu 可見。
public:
property bool IsOpen { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Browsable(false)]
public bool IsOpen { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.Browsable(false)>]
member this.IsOpen : bool with get, set
Public Property IsOpen As Boolean
屬性值
true若 是ContextMenu可見的;否則 。 false 預設值為 false。
- 屬性
範例
此範例展示了如何檢查該屬性是否 IsOpen 被設定為 true。
if (cm.IsOpen)
{
cmButton.Content = "The ContextMenu opened and the IsOpen property is true.";
}
If cm.IsOpen = True Then
cmButton.Content = "The ContextMenu opened and the IsOpen property is true."
End If
備註
當 IsOpen 設定為 true時,滑鼠捕捉設定為 及其 ContextMenu 子樹。
相依財產資訊
| 項目 | 價值 |
|---|---|
| 識別碼欄位 | IsOpenProperty |
元資料屬性設為 true |
BindsTwoWayByDefault |