title: c# drawing doesn't work right after form Initialized
body: <p>i tried to draw some boxes right after form is Initialized<br>
  however they didn't appeared.
  i put the code under the InitializeComponent();
  like this<br></p>
  
  <pre><code>    public Form2()
      {   InitializeComponent();
          System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.LimeGreen);
          System.Drawing.Graphics formGraphics = this.CreateGraphics();
         formGraphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 300)); }
  </code></pre>
  
  <p>but when i drew them after the form is initialized they worked!<br>
  So i thought i should wait a moment and draw the boxes.<br>
  Then i put the thread to make the draw function wait for 10ms<br>
  In short i modified the code like this</p>
  
  <pre><code>public Form2()
      {
          InitializeComponent();
  
  
          Thread t1 = new Thread(new ThreadStart(Run));
          t1.Start();
      }
  
      void Run()
      {
          Thread.Sleep(10);
          System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.LimeGreen);
          System.Drawing.Graphics formGraphics = this.CreateGraphics();
              formGraphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 300));
      }
  </code></pre>
  
  <p>and i succeed
  So my question is why i have to wait for a moment to draw something right after the form is initialized?<br>
  and is there any way to solve this problem not using thread?</p>