c# 怎么在代码中对所有button控件操作啊小弟我想数组,但如何搞

c# 如何在代码中对所有button控件操作啊,我想数组,但怎么搞RT[解决办法]C# codeListButton btns new L

c# 如何在代码中对所有button控件操作啊,我想数组,但怎么搞
RT  


[解决办法]

C# code
List<Button> btns = new List<Button>();btns.Add(button1);
[解决办法]
C# code
List<Button> btns = new List<Button>();foreach (Control control in Controls)  {   if (control is Button)     {      btns.Add(control);    }  }
[解决办法]
C# code
            List<Button> btns = new List<Button>();            foreach (Control control in Controls)            {                if (control is Button)                {                    btns.Add(control as Button);                }            }