wpf Button 背景放图片去掉鼠标移上去的白色背景

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32961291/article/details/78900440
 <Style TargetType="{x:Type Button}">
                     <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="0">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

猜你喜欢

转载自blog.csdn.net/qq_32961291/article/details/78900440