/// <summary>
/// 遍历控件使其全都不能使用
/// </summary>
/// <param name="P">父控件名称</param>
public static void ForeachCtlNo(Control P)
{
foreach(Control control in P.Controls)
{
if (control is TextBox)
{
TextBox t = (TextBox)control;
t.Enabled = false;
t.Text = "";
}
if (control is ComboBox)
{
ComboBox t = (ComboBox)control;
t.Enabled = false;
t.Text = "";
}
}
}
最后
以上就是机灵树叶最近收集整理的关于C#遍历控件的全部内容,更多相关C#遍历控件内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复