1、代码添加 按钮
Button st_1 = new Button();
st_1.Text = "asas";
this.Controls.Add(st_1);
2、代码绑定事件
private void button1_Click(object sender, EventArgs e)
{ //添加按钮
Button st_1 = new Button();
st_1.Text = "asas";
this.Controls.Add(st_1);
//添加事件
st_1.Click += new System.EventHandler(button_st_1_MouseClick);
}
//定义事件
private void button_st_1_MouseClick(object sender, EventArgs e)
{
MessageBox.Show("click");
}