Solved

Background thread is locking animated gif in windows form

Posted on 2011-03-22
1
605 Views
Last Modified: 2012-05-11
Hello experts,
I have created a windows form in vs 2008, that is multi threaded.  When the heavy work is being performed I would like the form to display an animated gif.  I have added the animated gif to a picure box and i use a backgroundworker control to handle the heavy work.  The animated gif just locks up until the backgroundworker control has finished.  I have no idea why this isnt working.  I have tried building my own background threads using delegate calls and invokes and the same thing happens.  I added the code below is there something else i can do.
Private Sub Quality_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
pb_drawing.imagelocation = "animated.gif"    'I tried doing this and also set the property before the form loads still doesnt work  
  Me.Cursor = Cursors.WaitCursor
            bgworker.RunWorkerAsync()
End Sub


 Private Sub bgworker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgworker.DoWork
  build_drawing_file 'this process takes a while
End Sub

Open in new window

0
Comment
Question by:tentavarious
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 35193720
What is happening in DoWork()?...this is key!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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