Thursday, 30 July 2015

Change Background Color According to Time

Change Background Color According to Time


Step-1:-Add/Take Timer into Windows Application.






Step-2:-Create Click Event of Timer
 

Step-3:-// create object of class Random
-------------------------------------------------------------------------------------------------------------------
                    Random chng_Clr = new Random();
                     int TimeInterval = chng_Clr.Next(100000, 999999);
                     this.BackColor=System.Drawing.ColorTranslator.FromHtml("#"+TimeInterval );
-------------------------------------------------------------------------------------------------------------------

Step-4:-Run the Application.

No comments:

Post a Comment

Factorial of a Number

Recently Viewed