Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Background thread is locking animated gif in windows form

Posted on 2011-03-22
1
Medium Priority
?
609 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
1 Comment
 
LVL 86

Accepted Solution

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

971 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