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,036 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 69

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now