日期:2014-05-18 浏览次数:21121 次
List<Button> btns = new List<Button>(); btns.Add(button1);
------解决方案--------------------
List<Button> btns = new List<Button>();
foreach (Control control in Controls)
  {
   if (control is Button)  
   {
      btns.Add(control);
    }
  }
------解决方案--------------------
            List<Button> btns = new List<Button>();
            foreach (Control control in Controls)
            {
                if (control is Button)
                {
                    btns.Add(control as Button);
                }
            }