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 new windows without blocking the user interface

Now, we have to add an event handler to display the form when the user clicks on the thumbnail's picture box, without blocking the user interface:

  1. Stay in the project, ImageBrowser.
  2. Open the code for the Windows Form Form1 (frmMain).
  3. Now, we will create a generic procedure for handling the picturebox control click event, receiving the same parameters as the corresponding event handler:
    private void PictureBoxClickProcedure(object sender, System.EventArgs e)
    {
    PictureBox loPictureBox = (PictureBox)(sender);
    frmShowFullImage loForm = new frmShowFullImage();
    loForm.psImageFileName = psImageFileName;
    loForm.piBrightnessDelta = (double)loPictureBox.Tag;
    loForm.Show(this);
    }
    
  4. Add ...

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