问题描述
当一个 TabItem
具有焦点时,它显示一个内部的虚线countour。如何使它透明或禁用它以获得焦点?
如果您正在讨论FocusVisualStyle,您可以通过将以下内容添加到您的TabControl中来删除它:
< TabControl ...>
< TabControl.Resources>
< Style TargetType =TabItem>
< Setter Property =FocusVisualStyleValue ={x:Null}/>
< / style>
<! - ... - >
< / TabControl>
更新 p>为了确保我们谈论的是相同的事情。
使用FocusVisualStyle(虚线)选择
未选中FocusVisualStyle。这是当TabItem已经聚焦(通过键盘设置)并且FocusVisualStyle被设置为空的时候你会看到的样子
When a TabItem
has focus it shows an inner dashed countour. How to make it transparent or to disabling it to get focus at all?
If you're talking about the FocusVisualStyle you can remove it by adding the following to your TabControl
<TabControl ...>
<TabControl.Resources>
<Style TargetType="TabItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
</Style>
</TabControl.Resources>
<!-- ... -->
</TabControl>
Update
To make sure we're talking about the same thing
Selected with FocusVisualStyle (dashed countour)
Selected without FocusVisualStyle. This is the look you'll get when the TabItem has focused (set by keyboard) and FocusVisualStyle is set to null
这篇关于如何禁用TabItem的虚线轮廓?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!