日期:2014-05-18 浏览次数:21112 次
Timer timer = new Timer();
List<Button> btns;
int i = 0;
public Form2()
{
InitializeComponent();
btns = new List<Button>();
foreach (Control con in this.Controls)
{
if (con is Button)
{
btns.Add(con as Button);
}
}
i = btns.Count;
timer.Interval = 5000;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
//throw new NotImplementedException();
btns[i - 1].ForeColor = Color.Red;
i--;
}
------解决方案--------------------
源码已发