i want to change color of form after every 3 sec. in vc#. How it can be done with the help of timer. Do i need to use a loop if yes then how?
Thanx
Thanx
private void timer1_Tick(object sender, EventArgs e) { this.BackColor = Color.Red; }
Random rndObj = new Random(); if(rndObj.Next(1, 4).ToString()== "1") { this.BackColor = Color.Red; } else if(rndObj.Next(1, 4).ToString()== "2") { this.BackColor = Color.Green; } else if(rndObj.Next(1, 4).ToString()== "3") { this.BackColor = Color.Yellow; } else { this.BackColor = Color.White; }
Timer1.start();
public int a=10;
a--; if(a==10) this.backcolor= color.red; else if(a==9) this.backcolor= color.blue;
Comment