VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Constantly change color of a label using a timer control.

by Aswin (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 8th October 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Constantly change color of a label using a timer control.

Rate Constantly change color of a label using a timer control.



'create another timer control ('tmrTim2') with the interval property set to 500
'let there be two labels ('lblA' and 'lblB') with backcolor as vbBack
'lblA changes color
'lblB flickers


private sub tmeTim1_timer()
lblA.forecolour=RGB(rnd * 256 + 1, rnd * 256 + 1, rnd * 256 + 1)
end sub

private sub tmrTim2_timer()
intTim = intTim + 1
if (intTim Mod 2 = 0) then
lblB.forecolor = vbBlack
else
lblB.forecolor = vbGreen
end if
end sub


Download this snippet    Add to My Saved Code

Constantly change color of a label using a timer control. Comments

No comments have been posted about Constantly change color of a label using a timer control.. Why not be the first to post a comment about Constantly change color of a label using a timer control..

Post your comment

Subject:
Message:
0/1000 characters