Loading gif for a winform, when i click a button i need to show loading gif then after some action it should not be displayed.
I can find tutorial for web form, but am struggling to do the same for winform, pls. suggest some idea.
Thanks, Karthick
The standard PictureBox
control can display animated GIFs.
Make a PictureBox
on your form, set its Image
property to an animated GIF, and set its Visible
property to false
.
Then, when you want to perform your action, set the PictureBox
's Visible
property to true
in code, perform the action, and set it to false
again.
Note that if you perform your action on the UI thread, the form, including the animation, will freeze until it finishes. To solve this, look at the BackgroundWorker
component.
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