/// <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 = "";
}
}
}
/// 遍历控件使其全都不能使用
/// </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 = "";
}
}
}