title: C# Best Method to Dim Screen, Multiple Windows Forms?
body: <p>So I've written code to create a new Windows form from the parent that is fullscreen, black and opacity of 80% to create a dimming effect.</p>
  
  <p>Then another form is shown above this to show progress.</p>
  
  <p>The code is currently looking like this:</p>
  
  <pre><code>    this.Enabled = false;
  
      frmDimScreen.BackColor = Color.Black;
      frmDimScreen.Opacity = .8;
      frmDimScreen.FormBorderStyle = FormBorderStyle.None;
      frmDimScreen.Size = new Size(splitContainerMain.Width - 4, splitContainerMain.Height - 2);
      frmDimScreen.StartPosition = FormStartPosition.Manual;
      frmDimScreen.ShowIcon = false;
      frmDimScreen.ShowInTaskbar = false;
      frmDimScreen.Show();
      frmDimScreen.Location = new Point(splitContainerMain.Location.X + 2,         ((splitContainerMain.Location.Y + tsMainTools.Height) - 4));
  
      addImgIL.ShowIcon = false;
      addImgIL.ShowInTaskbar = false;
      addImgIL.TopMost = true;
      addImgIL.Show();
      addImgIL.Location = new Point((this.Width - addImgIL.Width) / 2, (this.Height -         addImgIL.Height) / 2);
      addImgIL.BringToFront();
  </code></pre>
  
  <p>Obvioulsy the main reason I'm questioning this is if the parent window loses focus, then the child forms get out of order and are not layered correctly. I know I can handle this via OnPaint, but looking for the best solution.</p>
  
  <p>The question/problem, is this the best method to achieve what I am attempting? Should I be using forms or graphics to create the dimming? What's everyones experience with this?</p>
  
  <p>Thanks in advance!</p>