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 - Invoking multiple asynchronous user interface updates from many threads

Now, we must add a DataGridView and create a new delegate to update the user interface from many threads using an asynchronous execution to avoid performance degradation:

  1. Stay in the project, MarsEncrypter.
  2. Open Windows Form Form1 (frmMarsEncrypter) in the form designer and add a DataGridView control, dgvFilesToEncryptProgress.
  3. Open the code for the Windows Form Form1 (frmMarsEncrypter).
  4. Add the following declaration in the instance variables zone:
    // The list to hold the FileToEncryptProgress instances for each new file to encrypt
    List<FileToEncryptProgress> paoFilesToEncryptProgress = new List<FileToEncryptProgress>();
    
  5. Add the following declaration in the instance ...

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