Click here to Skip to main content
16,018,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi when i click the button, i want to display loading.gif image in windows form. after the calling methods has been executed the loading.gif image need to be hidden

i used picturebox and image but when i click the button the loading.gif not animated it's just displaying as static image but i want to display animated image until the calling method need to be executed.


how is possible can you help me....
Posted

Sounds like you don't get repaint happening but have the right direction, picturebox plus image will work if you do not disable the picture box.

My guess is that you should offhand the working part of the method to another thread to enable paints of the ui thread to happen, and it will work because your ui thread repaints periodically when not busy

perhaps use a background worker, threadpool or manually created thread to do the work and let ui be ui and it will look sharp
 
Share this answer
 
.NET Framework does not support gif animation. When you load an animated gif using Image class, just the first frame will be displayed.
 
Share this answer
 
If you want, you can also use DirectX, but it is a bit complicated...

This website is in Italian, but I think it's a good resource, maybe you can translate it with Google Translate. Search for DirectX9 Tutorials and look for audiovideo.
http://robydx.135.it/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900