title: Big windows on windows forms are slow and freezes
body: <p>I've encountered a problem when I try to create a windows forms window in a large size (for example, 4500X4500- I use VScroll and HScroll for that purpose) filled with pictured boxes. It is taking a long time to initialize the window, and when it is finally created, It is reacting very slow, often freezes and even froze my entire computer for a while.
  When I tried to initialize it for 5000X5000, it even threw an exception:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.ComponentModel.Win32Exception'
    occurred in System.Windows.Forms.dll</p>
    
    <p>Additional information: Error creating window handle.</p>
  </blockquote>
  
  <p>this is the intialization code:</p>
  
  <pre><code> public Map(int width, int height, ToolBox toolbox)
      {
          InitializeComponent();
          toolBox = toolbox;
          this.Width = width * 50;
          this.Height = height * 50;
          pic = new PictureBox[width, height];
          for (int i = 0; i &lt; width; i++)
          {
              for (int j = 0; j &lt; height; j++)
              {
                  pic[i, j] = new PictureBox();
                  pic[i, j].Size = new Size(50, 50);
                  pic[i, j].Left = i * 50;
                  pic[i, j].Top = 24+ (j * 50);
                  pic[i, j].Click += Map_Click;
                  this.Controls.Add(pic[i, j]);
              }
          }
          VScrollBar vScrollBar1 = new VScrollBar();
          vScrollBar1.Dock = DockStyle.Right;
          this.AutoScroll = true;
          Controls.Add(vScrollBar1);
          HScrollBar hScrollBar1 = new HScrollBar();
          vScrollBar1.Dock = DockStyle.Bottom;
          this.AutoScroll = true;
          Controls.Add(hScrollBar1);
      }
  </code></pre>
  
  <p>Note that it works perfectly fine when the sizes are lesser, like 2500X2500.
  <br />Edition:<br />
  Pay attention that the sizes stated are the width*50,height*50, not the width, height.</p>