user3568103
user3568103

Reputation:

How to make picturebox change image smooth and fast

I got a picture box that got an original image in my program. When i hover with my mouse over it it changes picture to another picture and when i leave it changes back. But.. There is such a delay to change to the right picture if i hover over it or not. It takes like 1 second before it changes, What should i change to improve the speed of the change? This is the code i am using at the moment:

private void pictureBox1_MouseHover(object sender, EventArgs e)
    {
        pictureBox1.Image = ABC_Bok.Properties.Resources.BokVänsterhörn_1;
    }

    private void pictureBox1_MouseLeave(object sender, EventArgs e)
    {
        pictureBox1.Image = ABC_Bok.Properties.Resources.BokVänsterhörnet;
    }

Upvotes: 0

Views: 1040

Answers (1)

jmcilhinney
jmcilhinney

Reputation: 54417

This is the third time today that I've seen this issue. MouseHover is raised when the mouse pointer STOPS OVER a control. If you want something to happen as soon as the mouse pointer goes over the control then you want MouseEnter, just as you're using MouseLeave for the change back again.

Upvotes: 2

Related Questions