[英]How do I enable or disable a column of textboxes?
Now I want to enable or disable that column of textboxes in the best possible way, perhaps not using array or loops. 现在,我想以最佳方式启用或禁用该列文本框,也许不使用数组或循环。 How do I do it?
我该怎么做?
// create a column of textboxes dynamically
private void CreateControl(int ControlId)
{
CheckBox control1 = new CheckBox();
control1.Click += new EventHandler(chk_CheckedChanged);
Point point = GetPoint(ControlId);
control1.Location = point;
this.Controls.Add(control1);
}
// a check box to enable or disable that column of textboxes
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
Column column = new Column();
CheckBox chk = (CheckBox) sender;
if (chk.Checked)
{
column.EnterName.Enabled = true;
// I want to enable or disable the entire column of textboxes
}
}
Public Class Column
{
public TextBox EnterName {get;set;}
}
I think that'd work. 我认为那行得通。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.