FocusManager.IsFocusScope 附加屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷附加這個屬性的項目是否為焦點範圍。
C#
see GetIsFocusScope, and SetIsFocusScope
see GetIsFocusScope, and SetIsFocusScope
see GetIsFocusScope, and SetIsFocusScope
下列範例會建立 StackPanel 焦點範圍。
XML
<StackPanel Name="focusScope1"
FocusManager.IsFocusScope="True"
Height="200" Width="200">
<Button Name="button1" Height="50" Width="50"/>
<Button Name="button2" Height="50" Width="50"/>
</StackPanel>
焦點範圍是可追蹤其範圍內 之的 FocusManager.FocusedElement 容器專案。 根據預設,類別 Window 是焦點範圍,如同 Menu、 ContextMenu和 ToolBar 類別。 焦點範圍的項目已 IsFocusScope 設定為 true
。
如需焦點、鍵盤焦點和邏輯焦點的詳細資訊,請參閱 輸入概觀。
標識元欄位 | IsFocusScopeProperty |
設定為的元數據屬性 true |
無 |
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |