Link to home
Start Free TrialLog in
Avatar of tentavarious
tentavarious

asked on

Background thread is locking animated gif in windows form

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

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial