如何设置五角形按钮的圆角半径

时间:2015-12-28 08:59:38

标签: c# wpf xaml

如何设置五角形按钮的圆角半径。这是我五角形用户控件的代码。我是wpf的新手,所以遇到困难请帮帮我。

 < UserControl.Resources >
    <Style x:Key="Poly1" TargetType="Button">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border CornerRadius="20,20,20,20" BorderThickness="5" >
                    <Grid Height="Auto" Width="Auto">
                        <Polygon   Points="0,0 175,0 250,50 175,100 0,100          
          0,45" Fill="{TemplateBinding Background}" StrokeThickness="2" 
         Stretch="Fill"/>
                        <ContentPresenter HorizontalAlignment="Center" 
       VerticalAlignment="Center" />
                    </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value="0.8" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                < /ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 < /UserControl.Resources>

0 个答案:

没有答案