title: creating windows form background with multiple blocks
body: <p>Hello it might be a silly question but i can't figure out the problem here..
  here is my code to fill a form with a single block:</p>
  
  <pre><code>        private void drawBackground()
      {
          Graphics g = genPan.CreateGraphics();
          Image Block = Image.FromFile(@"C:\Users\Administrator\Desktop\movment V1\movment V1\images\BrownBlock.png");
          float recWidth = Block.Width; 
          // rectangle width didnt change the name from previous code, it's picture width.
  
          float recHeight = Block.Height;
          // rectangle Heightdidnt change the name from previous code, it's picture Height.
  
          float WinWidth = genPan.Width; // genPan is a panel that docked to the form
  
          float WinHeight = genPan.Height;
  
          float curWidth = 0; //indicates where the next block will be placed int the X axis
          float curHeight = 0;//indicates where the next block will be placed int the Y axis
  
          while ((curHeight + recHeight) &lt;= WinHeight)
          {
              if (curWidth &gt;= WinWidth / 3 || curWidth &lt;= WinWidth / 1.5 ||
                  curHeight &gt;= WinHeight / 3 || curHeight &lt;= WinHeight / 1.5)
              {
                  g.DrawImage(Block, curWidth, curHeight, recWidth , recHeight );
              }
              curWidth += recWidth;
              if ((WinWidth - curWidth) &lt; recWidth)
              {
                  curWidth = 0;
                  curHeight += 50;
              }
          }
      }
  </code></pre>
  
  <p>If I launch this func through a button it will work perfectly fine.
  But if I launch the func after the InitializeComponent(); method in the constructor OR in a FORM shown event, while the button is still on the form
  it will execute the func however the block backgroud wont be visible but the grey color will be.
  but if i remove the button the background will be visible. =\</p>
  
  <p>I cant understand why is it happening, how to fix it and what am I doing wrong..
  can anyone explain please..?</p>