I added a gif to a PictureBox and when the form is loaded I disabled the PictureBox to stop playing the gif. Then when I hover cursor on PictureBox I would like to enable the PictureBox to start playing the gif, but it doesn't play the gif.
Why I cannot enable the PictureBox and play the gif on mouse hover and how can I solve this problem?
code:
private void MainPage_Load(object sender, EventArgs e)
{
pictureBox1.Enabled = false;
}
private void pictureBox1_MouseHover(object sender, EventArgs e)
{
pictureBox1.Enabled = true;
}
private void pictureBox1_MouseLeave(object sender, EventArgs e)
{
pictureBox1.Enabled = false;
}