-4
これは
public System.Windows.Forms.Button creatbtn()
{
for (int i = 0; i < 20; i++)
{
btn = new System.Windows.Forms.Button();
this.Controls.Add(btn);
btn.Top = c * 28;
btn.Left = 150;
btn.Text = "button" + this.c.ToString();
c = c + 1;
}
return btn;
}
ボタンを水平方向に並べるために 'Top'の代わりに' Left'を動的に計算します - 現在** **垂直に整列しています –
'btn.Top = 28; btn.Left = 150 + c * 80; ' –