首页 > Windows开发 > 详细

WPF中textBlock 变色功能

时间:2019-03-12 10:12:32      阅读:258      评论:0      收藏:0      [点我收藏+]
       
  <Window.Resources>
 <Storyboard x:Key="OnLoaded" RepeatBehavior="Forever" AutoReverse="True"  >
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="btn_Register">
                <EasingColorKeyFrame KeyTime="0:0:1" Value="LightBlue"/>
                <EasingColorKeyFrame KeyTime="0:0:2" Value="LightGreen"/>
            </ColorAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard  Storyboard="{StaticResource OnLoaded}"/>
        </EventTrigger>
    </Window.Triggers>
<Button
                    Name="btn_Register"
                    Margin="62,26,-60,2"
                    Content="新用户注册"
                    Command="{Binding Path=RegisterCmd}"
Foreground="#FF91B9EA" Grid.Column="2" Width="Auto" FontWeight="Bold" FontSize="14"/>

 

WPF中textBlock 变色功能

原文:https://www.cnblogs.com/yuejian/p/10514705.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!