WPF带小箭头的按钮
2021-06-09 20:04
标签:click key hide ack img ide aml none over XAML代码: 效果图: WPF带小箭头的按钮 标签:click key hide ack img ide aml none over 原文地址:https://www.cnblogs.com/lonelyxmas/p/10641769.htmlControlTemplate x:Key="btnTpl" TargetType="RadioButton">
StackPanel Orientation="Vertical" Height="30" Background="Transparent">
Border Name="border" Background="#006AB8" Height="25">
ContentPresenter Name="contentPre" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.Foreground="#FFF" TextElement.FontSize="12" Margin="0"/>
Border>
Path x:Name="path" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 6 4 L 12 0 Z">
Path.Fill>
SolidColorBrush Color="#006AB8" />
Path.Fill>
Path>
StackPanel>
ControlTemplate.Triggers>
Trigger Property="IsMouseOver" Value="True">
Setter TargetName="border" Property="Margin" Value="2 2 2 0">Setter>
Setter TargetName="border" Property="Height" Value="23">Setter>
Setter Property="TextElement.FontSize" Value="11">Setter>
Trigger>
Trigger Property="IsChecked" Value="true">
Setter TargetName="border" Property="Border.Background" Value="#15BDF7">Setter>
Setter TargetName="path" Property="Fill" >
Setter.Value>
SolidColorBrush Color="#15BDF7" />
Setter.Value>
Setter>
Trigger>
ControlTemplate.Triggers>
ControlTemplate>
上一篇:WPF文字间距
下一篇:WPF定时刷新UI界面