Repeat code several times when view is defined

I want to run a specific method every x milliseconds when a form is visible (to change the contents of the image window in that form, to be precise, the animation is displayed) without explicitly blocking events. I cannot load .gif, since I will use sprites and satin files. I believe this approach goes beyond the event-driven programming language paradigm that comes with .net / C #. I am not sure of the correct way to solve this problem - perhaps using a stream, but that sounds a bit overdone - any suggestions?

+4
source share
1 answer

You can use a timer that will fire an event at regular intervals. As for the fact that while the form is visible, you can turn off the timer when the form is minimized or hidden, and turn it on again when it is shown again.

+4
source

All Articles