private void ClearControl(Control sender)
{
foreach (Control item in sender.Controls)
{
if (item is CoreTextBox || item is CoreComboBox)
{
item.text = string.Empty;
continue;
}
if (item.Controls.Count > 0)
ClearControl(item);
}
}
小结:方法内可自调方法,即反复递归调用自身
{
foreach (Control item in sender.Controls)
{
if (item is CoreTextBox || item is CoreComboBox)
{
item.text = string.Empty;
continue;
}
if (item.Controls.Count > 0)
ClearControl(item);
}
}
小结:方法内可自调方法,即反复递归调用自身
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-716009/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-716009/