颜色循环C#Bunifu
我需要帮助使我的颜色循环不停地继续 我试着循环计时器,但没有工作,我也使用布尼福颜色循环C#Bunifu,bunifu,Bunifu,我需要帮助使我的颜色循环不停地继续 我试着循环计时器,但没有工作,我也使用布尼福 private void Form2_Load(object sender, EventArgs e) { panelColor(panel1, logo); bunifuColorTransition1.ProgessValue = 0; bunifuColorTransition1.Color1 = panel1.BackColor; bunifuColorTransition1
private void Form2_Load(object sender, EventArgs e)
{
panelColor(panel1, logo);
bunifuColorTransition1.ProgessValue = 0;
bunifuColorTransition1.Color1 = panel1.BackColor;
bunifuColorTransition1.Color2 = Color.FromArgb(210, 132, 120);
timer1.Start();
}
public void panelColor(Panel h, BunifuImageButton x)
{
panel1 = h;
logo = x;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (bunifuColorTransition1.ProgessValue < 100)
{
BunifuColorTransition bunifuColorTransition = bunifuColorTransition1;
int progessValue = bunifuColorTransition.ProgessValue;
bunifuColorTransition.ProgessValue = progessValue + 1;
panel1.BackColor = bunifuColorTransition1.Value;
logo.BackColor = bunifuColorTransition1.Value;
return;
}
timer1.Stop();
}
private void Form2\u加载(对象发送方,事件参数e)
{
panelColor(panel1,徽标);
bunifuColorTransition1.ProgesValue=0;
bunifuColorTransition1.Color1=panel1.BackColor;
bunifuColorTransition1.Color2=Color.FromArgb(210132120);
timer1.Start();
}
公共空白面板颜色(面板h,BuniFunImageButton x)
{
第1组=h;
logo=x;
}
私有无效计时器1_刻度(对象发送方,事件参数e)
{
if(bunifuColorTransition1.ProgesValue<100)
{
BunifuColorTransition BunifuColorTransition=bunifuColorTransition1;
int progessValue=bunifuColorTransition.progessValue;
bunifuColorTransition.ProgessValue=ProgessValue+1;
panel1.BackColor=bunifuColorTransition1.Value;
logo.BackColor=bunifuColorTransition1.值;
返回;
}
timer1.Stop();
}
请有人帮忙,因为您可能只需要一个else{}
来包装timer1.Stop()
调用。试着这样做:if(bunifuColorTransition1.ProgessValue<100){//stuff}else timer1.Stop()代码>