VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Makes a command button blink with a random color each time it is visible.

by E. Stephens (3 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 16th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Makes a command button blink with a random color each time it is visible.

Rate Makes a command button blink with a random color each time it is visible.



'Add a timer and leave default name "Timer1"
'Add a command button and leave default name "Command1"
'Set the command button style property to "1-graphical"
'Add the following code to the Form load event and Timer1 event
'Enjoy!
'
Private Sub Form_Load()
Timer1.Interval = 900 'The bigger the number the longer the delay
End Sub

Private Sub Timer1_Timer()
If Command1.Visible = True Then
Randomize
Command1.BackColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
Command1.Visible = False
Else
Command1.Visible = True
End If
End Sub


Download this snippet    Add to My Saved Code

Makes a command button blink with a random color each time it is visible. Comments

No comments have been posted about Makes a command button blink with a random color each time it is visible.. Why not be the first to post a comment about Makes a command button blink with a random color each time it is visible..

Post your comment

Subject:
Message:
0/1000 characters