将以下节点复制到app.xaml的<Application.Resources>节点下

<Style TargetType="{x:Type Button}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border Name="Border" Background="{TemplateBinding Control.Background}">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"
                                      Content="{TemplateBinding ContentControl.Content}" />
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

相关文章:

  • 2022-12-23
  • 2021-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2021-12-16
  • 2021-12-06
  • 2021-06-30
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案