Friday, March 6, 2009

Using previously indtroduced Tween

In my previous post I introduced a Tween class, which lets you to manipulate object Properties in timely manner.
Let's consider we have a simple button on client area, which has "btnButton" name. The following code will change the button's width from 50 to 300 pixels in 3 seconds (3000 milliseconds).

Tween tmpTween = new Tween();
tmpTween.MaxValue = 300;
tmpTween.MinValue = 50;
tmpTween.Period = 10000;
tmpTween.Target = this.btnTest;
tmpTween.Property = "Height";
tmpTween.Start();

No comments: