日期:2014-05-18 浏览次数:20836 次
int x = 0; int y = 0; private void BianSeTime_Tick(object sender, EventArgs e) { textBox1.BackColor = Color.FromArgb(0, x, y); y++; if(y == 256) { y = 0; x++; } if(x == 256) { x = 0; y = 0; } }
------解决方案--------------------
循环过程中Sleep一下不就可以控制循环速度了吗?
for(int x=0;x <256;x++)
{
for (int y = 0; y < 256; y++)
{
textBox1.BackColor = Color.FromArgb(0, x, y);
System.Threading.Thread.Sleep(5000); //停半秒,时间根据你而定
}
System.Threading.Thread.Sleep(1000); //停1秒,时间根据你而定
}