http://www.dfwlt.com/forum.php?mod=viewthread&tid=946&page=1介绍


本文章介绍了Delphi XE6入门教程 - 通过TColorAnimation组件改变TRectangle组件的颜色,在之前一片文章中,已经介绍了 使用TFloatAnimation组件修改TRectangle组件的显示[http://www.dfwlt.com/forum.php?mod=viewthread&tid=945],让TRectangle组件在界面上旋转,这次在这个基础上,来讲下入何在选装的时候改变颜色。

1:我们打开之前的工程,然后在组件搜索框中输入TColorAnimation,找到TColorAnimation组件,并拖放到窗体上。

<ignore_js_op> <ignore_js_op> 


2:然后双标点击TColorAnimation组件,将这个组件拖放到TRectangle组件下面,使他变成TRectangle组件的子组件
<ignore_js_op> 


3:点击TColorAnimation组件,修改下面的属性为表格中的信息

Property Value Description
PropertyName Fill.Color Name of the property to animate.
Enabled True The animation starts when the application starts.
Duration 3 The amount of time (in seconds) to animate from the start value to the stop value.
Loop True Repeats the animation indefinitely.
AutoReverse True Animates backward after animating forward.
StopValue Red Terminates the animation of this property when it reaches this value.
<ignore_js_op> 


4:最后运行程序,可以看到如下效果
<ignore_js_op> 




 
 
 

转载请保留当前帖子的链接:http://www.dfwlt.com/forum.php?mod=viewthread&tid=946 谢谢! 

搜索简单,分享不易,且分享且珍惜,您难道不想分享下您的心得?如果觉得本文章好的话,您可以在我们网站上注册,然后发布您的好的心得,让大家共同进步,谢谢!