panel中的textbox
tbnames = new List<string>();
foreach (Control ctl in this.Controls)
{
foreach (Control ss in ctl.Controls)
{
if (ss.GetType() == typeof(TextBox))
{
if (ss.Text == "")
{
tbnames.Add(ss.Name);
}
}
}
}
form中的textbox
tbnames = new List<string>();
foreach (Control ctl in this.Controls)
{
if (ctl.GetType() == typeof(TextBox))
{
if (ctl.Text == "")
{
tbnames.Add(ctl.Name);
}
}
}