62,271
社区成员
发帖
与我相关
我的任务
分享
for (int i = 0; i < this.Controls.Count; i++)
{
foreach (Control control in this.Controls[i].Controls)
{
if (control.HasControls())
{
//子控件
}
else
{
if (control is TextBox)
{
((TextBox)control).Enabled = false;
}
}
}
}
foreach (Control control in this.Form.Controls)
{
if (control is TextBox)
{
TextBox textbox = (TextBox)control;
textbox.Text = "1";
}
}