wpf Button 动态改变效果

   <Button  x:Name="LearnMore"  Grid.Row="6"  HorizontalAlignment="Left" VerticalAlignment="Top" Click="go_webSite" >

                        <Button.Template>

                            <ControlTemplate TargetType="Button">

                                <Border Background="{TemplateBinding Button.Background}"  Cursor="Hand" CornerRadius="21" Height="42" Width="160">

                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">

                                        <TextBlock  Height="25" VerticalAlignment="Center" Margin="0,4,0,0" Width="73" Foreground="#FFFFFF" FontSize="18"   TextAlignment="Center"  >了解更多</TextBlock>

                                        <Image Width="14" Margin="8,2,0,0" Height="12" Source="/Imgs/arrow.png" />

                                    </StackPanel>

                                </Border>

                                <ControlTemplate.Triggers>

                                    <Trigger  Property="Button.IsMouseOver"  Value="True">

                                        <Setter Property="Button.Background" Value="#0096D6" />

                                    </Trigger>

                                    <Trigger  Property="Button.IsMouseOver"  Value="false">

                                        <Setter Property="Button.Background" Value="#177BBF" />

                                    </Trigger>

                                    <Trigger  Property="Button.IsPressed"  Value="true">

                                        <Setter Property="Button.Background" Value="#2285C9" />

                                    </Trigger>

                                </ControlTemplate.Triggers>

                            </ControlTemplate>

                        </Button.Template>

                    </Button>

wpf Button 动态改变效果

上一篇:在Windows上使用qemu运行rt-thread


下一篇:SQL Server Replication - SQL Server镜像(转载)