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.
'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