O'Reilly logo

C# 2008 and 2005 Threaded Programming: Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - Showing the results in the UI

The application is boring, because it does not show any results in the UI. You have to change this for the good, because the NASA scientists have great expectations from your work.

Now, we are going to show the results in the UI, using a BackgroundWorker combined with a delegate to work in the UI thread:

  1. Stay in the project, BlobCounter.
  2. Open Windows Form Form1 (frmNebulaFinder) in the form designer.
  3. Set the BackgroundWorker bakDisplayImages WorkerSupportsCancellation property to True.
  4. Open the code for the Windows Form Form1 (frmNebulaFinder).
  5. Add the following declaration in the instance variables zone:
    private delegate void ShowImageCaller(Bitmap poBitmap);
    
  6. Add the following public method to display ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required