3
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by debasisdas
0

hi,can anyone help me with a code that can change form color after 10 seconds ,for example from yellow to red continiously.please help.

Hi
U can use Timer for this. Timer has interval property, which Specifies the number of milliseconds between calls to a Timer control's Timer event and Form.Backcolor property used to change the form color

Draw a Timer control and set its interval to 10000 (10 secs)
Use Form1.BackColor = vbRed This just change the BackColor to Red
Declare a boolean variable "flag" in Form Level (Top of the form) dim flag as boolean In the Timer1_Timer event Try the following
check flag variable , if it is false,
then Form1.BackColor = vbRed and make flag to true
else Form1.BackColor = vbYellow and make flag to false

0

try to use this

me.backcolor=rgb(rnd*255,rnd*255,rnd*255)

and call this on a timer .
set the timer interval as desired.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.