//遍历所有按钮 foreach (Control x in this.Controls) { Control y = x as Button; if (y != null) { //操作 } } //遍历n个按钮 for(int i=1;i<n;i++) { Button btn = this.Controls["button" + i.ToString()] as Button; //操作 }