代码很简单!如下,相信大家都看得懂的!
它的属性防就像在VS里面编写的属性一样的赋值上去就行了!
private void button1_Click(object sender, EventArgs e)
{
CheckBox cb = new CheckBox();
cb.Parent = this;
cb.Text = "动态添加控件";
}
代码短小精悍!