方案1:
<Window.Resources>
<ControlTemplate x:Key="CornerButton" TargetType="{x:Type Button}">
<Border BorderBrush="Green" BorderThickness="" CornerRadius="" Background="Red">
<ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
<ControlTemplate x:Key="yuanjiaoBtn" TargetType="{x:Type Button}">
<Border BorderBrush="Gray" BorderThickness="0.5" CornerRadius="" Background="Black">
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"/>
</Border> </ControlTemplate>
<ControlTemplate x:Key="CornerTextBox" TargetType="{x:Type TextBox}">
<Border BorderBrush="Blue" BorderThickness="" CornerRadius="" Background="#FFD5F0D4">
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Window.Resources>
<Canvas Background="#1b1b1b">
<Button x:Name="btnOK" Content="OK" Template="{StaticResource CornerButton}" Height="" Canvas.Top="" Width="" Canvas.Left="" Click="btnOK_Click"></Button>
<Button x:Name="btnCancel" Content="Cancel" Template="{StaticResource yuanjiaoBtn}" Height="" Canvas.Top="" Width="" Canvas.Left=""></Button>
<TextBox Template="{StaticResource CornerTextBox}" Canvas.Left="" Canvas.Top="" Height="" Name="textBox1" Width="" Background="#FF7FBC7D" />
<TextBox Template="{StaticResource CornerTextBox}" Canvas.Left="" Canvas.Top="" Height="" Name="textBox2" Width="" />
</Canvas>
方案2:
<Button Content="地图" Height="" Margin="555,282,466,393" Width="">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="" CornerRadius="3,13,3,13" Name="PART_Background">
<Border.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="Silver" Offset="0.5" />
<GradientStop Color="White" Offset="0.0" />
</LinearGradientBrush>
</Border.Background>
<ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="UIElement.IsMouseOver" Value="True">
<Setter Property="Border.Background" TargetName="PART_Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="Silver" Offset="0.0" />
<GradientStop Color="White" Offset="0.5" />
<GradientStop Color="Silver" Offset="0.0" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="ButtonBase.IsPressed" Value="True">
<Setter Property="UIElement.Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="" Color="Black" Direction="" Opacity="0.6" RenderingBias="Performance" ShadowDepth="" />
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>