请高手解释下,这个方法的含义
private void ControlInfo(Boolean B)
{
foreach (Control ct in this.groupBox1.Controls)
{
if (ct is TextBox)
{
if (B)
{
ct.Enabled = true;
}
else
{
ct.Enabled = false;
}
}
}
}
private void ControlInfo(Boolean B)
{
foreach (Control ct in this.groupBox1.Controls)
{
if (ct is TextBox)
{
if (B)
{
ct.Enabled = true;
}
else
{
ct.Enabled = false;
}
}
}
}
private void ControlInfo(Boolean B)
{
foreach (Control ct in this.groupBox1.Controls)
{
//遍历groupBox里的控件
if (ct is TextBox)
{
//如果该控件是TextBox
if (B)
{
//这个B是传递过来的参数,是做什么用的只有你才知道,要其它代码才知道
ct.Enabled = true;
//将该控件设为可用
}
else
{
ct.Enabled = false;
//将代码设为不可用
}
}
}
}
{
foreach (Control ct in this.groupBox1.Controls)
{
if (ct is TextBox)
{
ct .Enabled = B //这样不更好?? }
}
}
后面的.Controls是什么意思!!!
求解