How to disable the dashed contour for TabItem?

笑着哭i 提交于 2019-12-13 02:48:44

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/4286878/how-to-disable-the-dashed-contour-for-tabitem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!