站长苏飞 发表于 2013-5-23 14:31
还可以这样写,
你的方法有点另类了
private void SearchButton(Control c)
{
foreach (Control item in c.Controls)
{
if (item is Button)
{
//To do something
}
else
{
SearchButton(item);
}
}
}
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |