关于避免重复输入
就如以上这张图,我有 32 个按钮控件,为了实现代码的功能,怎么简化代码
2013-04-27 19:23
2013-04-27 19:54
2013-04-27 19:57
程序代码: private void SetVisible(Control control)
{
foreach (Control c in control.Controls)
{
if (c.HasChildren)
{
SetVisible(c);
}
else
{
var btn = c as Button;
if (btn != null)
btn.Visible = false;
}
}
}
2013-04-27 20:09
2013-04-27 20:22
2013-04-27 20:39
2013-04-27 22:18
2013-04-28 09:18
2013-04-28 11:01
2013-04-28 14:32