I've little question to ask.
Let's say I've written an ellipse on pictureBox, then clicked a button. I want pictureBox to refresh itself.
I've tried PictureBox.Invalidate()
, but could'nt made it.
My best regards...
Try the method PictureBox. Refresh() (inherited from Control ).
There are a couple ways to update the PictureBox, and the method you use makes a difference if you have some lag. I had a program that drew typed characters in a PictureBox, and the keystroke processing was slow so when I typed fast it would lag.
If I pictureBox.Refresh();
after each keystroke, then that refreshes the picture immediately after the keystroke is processed, no matter what. This way, when I typed fast I could see the PictureBox trying to catch up with me as it drew each character.
If instead I pictureBox.Invalidate();
, then that refreshes the picture too, but only when the system has some free time. This way, when I typed fast I saw nothing happening while the system tried to catch up, and then everything I'd typed suddenly appeared.
Usually Refresh is better, but here's an article that describes a couple situations where Invalidate is the better choice.
Try the method PictureBox.Refresh()
(inherited from Control
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With