Solved

how to show an animated wait GIF or AVI while long job is running in vb.net

Posted on 2011-03-06
4
1,050 Views
Last Modified: 2012-05-11
I added a GIF image in a picturebox to the windows form I am creating, however, it does not refresh continuously while a long job is executing. I have searched in the web, and developers advise to use AVI instead, I want to show the animation, whether by avi or gif. Can someone send me the VB.Net code to do this? Thanks
0
Comment
Question by:fmichail
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 35046949
It doesn't matter if you use gif or avi...the problem is the "while a long job is executing" part.  You need to move that job to another thread so the main UI thread is free to do the animation.

The easiest solution is to use the BackgroundWorker() control:
http://msdn.microsoft.com/en-us/library/8xs8549b.aspx
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker(VS.80).aspx
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 35047233
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35047254
That's a pretty control emoreau!

*It too, though, would not work if the author doesn't move the work to a different thread:
it does not refresh continuously while a long job is executing.
0
 

Author Closing Comment

by:fmichail
ID: 35047445
Thanks Idle_mind.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question