title: windows.forms.panel calling onPaint twice
body: <p>I have a panel with multiple panels inside of it.  I have overridden OnPaint in the master panel to the following:</p>
  
  <pre><code>    protected override void OnPaint(PaintEventArgs e)
      {
          Graphics graph = e.Graphics;
          graph.Clear(Color.Black);
          InvokePaintBackground(this, e);
  
          graph.ScaleTransform(scale, scale);
  
          foreach (childPanel child in childPanels)
          {
              child.onPaint(this, e);
          }
  
          graph.ResetTransform();
      }
  </code></pre>
  
  <p>The problem I have is that the onPaint function of the first control (control in spot 0) is being called twice so I am getting two versions of the child panel, one with scaling, and one without.  The second onPaint seems to be called by the child control itself.</p>
  
  <p>How do I keep it from doing this?</p>