按钮上的文字不显示

问题描述

我在 Buttons 标签中设置了 Windows.Resources 的样式。一切正常,除了 Content 没有显示。

<Window …>
    <Window.Resources>
        <Style TargetType="Button">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="White" />
                </Trigger>
            </Style.Triggers>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border CornerRadius="5" BorderThickness="1" BorderBrush="#989898"
                                Background="{TemplateBinding Background}" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="#0E121A" />
            <Setter Property="Margin" Value="3" />
            <Setter Property="Foreground" Value="White" />
        </Style>
    </Window.Resources>
    <Grid>
       …
       <Button Grid.Row="0" Grid.Column="2" Content="Send"
                        Click="ButtonActivateLicense_OnClick" />
    </Grid>
<Window>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)