private void Form1_Load(object sender, EventArgs e)
{
this.DoubleBuffered = true;
Button[] btn = new Button[30];
int iIndex = 0, iWidth = 0, iHeigth = 0;
iWidth = this.Width / 5;
iHeigth = this.Height / 6;
this.SuspendLayout();
for (int i = 0; i < 6; i++)
{
for (int j = 0; j < 5; j++)
{
btn[iIndex] = new Button();
btn[iIndex].Text = "btn" + iIndex.ToString();
btn[iIndex].Left = btn[0].Width * j;
btn[iIndex].Top = btn[0].Height * i;
btn[iIndex].Width = iWidth;
btn[iIndex].Height = iHeigth;
iIndex++;
}
}
this.Controls.AddRange(btn);
this.ResumeLayout();
}