怎么动态的添加button按钮。。。
道阻且长 2010-09-20 05:28:12 我想定义一个button数组。。然后通过for循环定义button
System.Windows.Forms.Button[] button=new System.Windows.Forms.Button[5];
button[0] = new System.Windows.Forms.Button();
this.SuspendLayout();
button[0].Location = new System.Drawing.Point(31, 35);
button[0].Name = "button[0]";
button[0].Size = new System.Drawing.Size(75, 23);
button[0].TabIndex = 0;
button[0].Text = "button1";
button[0].UseVisualStyleBackColor = true;
this.Controls.Add(button[0]);
但是弄出来的button不能点的。。也不能添加事件
问下要怎么弄。。