WPF button 圆角制作

将以下节点复制到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>

posted on 2013-06-28 10:50  认真的我  阅读(748)  评论(0编辑  收藏  举报