Timer control??

rajesh.forum

Well-known member
Joined
Sep 7, 2007
Messages
55
Programming Experience
Beginner
Hi
I want to change background color of button alternatively.With timer control i want to do this.Can anyone help
 
Plonk a timer on your form. Set it's interval to about 1000 or so..

VB.NET:
Private SwapColor As Boolean


In the timer event

VB.NET:
Dim _color as color

If SwapColor Then
_Color = Color.Red
Else
_Color = Color.Blue

Me.Button.BackColor = _Color

'Invert The SwapColor Boolean
SwapColor = Not SwapColor

Untested, but it looks something like that in my head :)
 
Back
Top