How To Get SOLIDWORKS 2019 With CrackHi everyone, welcome to another post.
In the previous posts we have learned about creating text box, how to give popup, how to start and stop animation.
In this post we will learn about making Button Grow.
So today I am starting with the Button and before that let’s start with Animation basics.
Animation is the animation from Point A to Point B.
For example let’s say we need to do animation of “Hi” text box to “Hello” text box.
Then we start with the text box, we will click anywhere from the text box and by clicking on it we make the text box grow.
We can use to animation the text box, animation also has these properties.
Now let’s start with the code.
// Do you want to play animation by pressing any key?
var PlayAnimation:Boolean = false;
After this I am defining the type of animation I want to do.
In this case I have created a animation using PNG images and I am providing the images with animation.
When it starts then I am applying the animation to the button.
1. StartAnimation() – Now I start the animation.
2. ClearAnimation() – I clear the animation.
3. StopAnimation() – I stop the animation.
A button is also part of the UIElement, UIElement has some properties, we can use them for setting and getting the state of a UI object, so we have properties of animation, style, text, background etc.
var btn = Button();
btn.Background = new SolidColorBrush(Colors.Green);
btn.Animation = “Animation1”;
Now I have created a button with some style, background color and animation.
I have added some methods for playing the animation, now I have added the animation, I can play the animation by pressing any key.