【问题标题】:Remove the button border including the 'tab event' in wpf?删除包含 wpf 中的“选项卡事件”的按钮边框?
【发布时间】:2013-08-26 04:11:10
【问题描述】:

我设法通过使用这种样式完全删除了按钮边框

    <Style x:Key="TransparentStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Background="Transparent">
                        <ContentPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

但是,如何去掉TAB键出现的黑色虚线边框呢?

【问题讨论】:

    标签: wpf button


    【解决方案1】:

    那将是显示虚线的FocusVisualStyle,尝试将其设置为 x:Null

    【讨论】:

    • 它就像魅力一样。这是分享的来源。 &lt;Button x:Name="Button1" Width="475" Height="89" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" FocusVisualStyle ="{x:Null}" &gt;
    • @user2711132 是的,或者如果您使用的是您共享的透明样式,您可以将其放入样式的设置器中
    猜你喜欢
    • 2012-04-15
    • 2015-02-23
    • 1970-01-01
    • 1970-01-01
    • 2011-09-18
    • 2015-03-17
    • 1970-01-01
    • 1970-01-01
    • 2012-01-23
    相关资源
    最近更新 更多