Click here to Skip to main content
15,936,903 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys... i would like to ask how can you stop the looping animation of a gif image on a picturebox or on a button? im loading a gif image upon mouse hover and change the gif image again on mouseleave. but i notice that this gif image keeps on looping eventhough we set the loop property in photoshop to be no loop. so we were expecting that the image will not loop but it was not the case... how can we stop the looping of a gif image?
here is my code for loading the gif image

C#
private void pictureBox1_MouseHover(object sender, EventArgs e)
        {
            pictureBox1.Image = ((System.Drawing.Image)(Properties.Resources.mousehoverGIF));

        }

private void pictureBox1_MouseLeave(object sender, EventArgs e)
        {
            pictureBox1.Image = ((System.Drawing.Image)(Properties.Resources.mouseleaveGIF));
        }
Posted

1 solution

This may help: "C# Displaying Animated GIF"[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900