You can use a series of images instead of gifs. You can use the timer and set the interval to the desired speed. The timer will change the image of the button on each tick. For this you need a gif framework. You can go to → http://gif-explode.com/ . Put the gif there and get every frame. Then you can put the images in the image list. I assume that you want the animation to start when the button is clicked.
int i = 0;
private void timer1_Tick(object sender, EventArgs e)
{
if (i == imageList1.Images.Count)
{
timer1.Stop();
i = 0;
}
button1.Image = imageList1.Images[i];
i++;
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
source
share