连续给多个控件属性赋值~~~
例如:this.comboBox1.Enabled = false;
this.textBox2.Enabled = false;
this.textBox3.Enabled = false;
this.button2.Enabled = false;
this.button3.Enabled = false;
我要怎么连续给他们的属性赋值同一个值?
有人做出来了吗?循环吗 谢谢回答 --------------------编程问答--------------------
没试过,不知道是不是这样--------------------编程问答-------------------- 把要赋值同一个值的放到一个GroudBox里面
this.comboBox1.Enabled = this.textBox2.Enabled = this.textBox3.Enabled = this.button2.Enabled = this.button3.Enabled = false;
然后
foreach(Control c in GroundBox.Controls)
{
c.Enable =false;
} --------------------编程问答-------------------- void set(Controls controls)
foreach(Control c in controls)
{
if(c is Button)
{
c.Enable =false;
}
else
controls(c)
} --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答--------------------
补充:.NET技术 , C#