Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1106
  • Last Modified:

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

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
fmichail
Asked:
fmichail
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
fmichailAuthor Commented:
Thanks Idle_mind.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now