我希望我的程序不断改变字体背景颜色,但我希望它顺利进行,所以我尝试修改一个 Color 变量 Color custom;
并将其用于形成 this.BackColor = custom;
但它不起作用,我不知道如何让它起作用,这是完整的代码:
private void Principal_Load(object sender, EventArgs e)
{
Color custom;
int contr = 0, contg = 0, contb = 0;
do
{
while (contr < 255 && contg == 0)
{
if (contb != 0)
{
contb--;
}
contr++;
while (contg < 255 && contb == 0)
{
if (contr != 0)
{
contr--;
}
contg++;
while (contb < 255 && contr == 0)
{
if (contg != 0)
{
contg--;
}
contb++;
}
}
}
custom = Color.FromArgb(contr, contg, contb);
this.BackColor = custom;
} while (true);
}
最佳答案
关于c# - 不断改变表格颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30432056/