private void CleanForm()
{
foreach (var c in this.Controls)
{
if (c is TextBox)
{
((TextBox)c).Text = String.Empty;
}
}
}
Run Code Online (Sandbox Code Playgroud)
上述方法不起作用,并且不清除控件.编译很好,但什么都不做.
有任何想法吗?