C#
C#中怎么动态生成多个按钮和动态生成单击事件!! --------------------编程问答-------------------- for (int i = 0; i < 5; i++){
Button btn = new Button();
btn.Name = "btn" + i;
btn.Text = "button" + i.ToString();
btn.Location = new System.Drawing.Point(100 + i * 10, i * 20 + 10);
btn.Size = new System.Drawing.Size(50, 20);
btn.Click += new EventHandler(btn_Click);
this.Controls.Add(btn);
}
void btn_Click(object sender, EventArgs e)
{
throw new Exception("The method or operation is not implemented.");
}
补充:.NET技术 , C#