Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label Caption Blink or Flash off and on

Status
Not open for further replies.

Bojangles

Programmer
May 27, 2000
32
0
0
When a certain event takes place, I want to make a label caption blink off and on until the event concludes. What is the best way to do this?
Thanks,
Bojangles
 
The easy way is to use a Timer with Interval set to 1000 and Enabled set to False.

Use this in the timer code:

Private Sub Timer1_Timer()
Dim temp
temp = Label1.ForeColor
Label1.ForeColor = Label1.BackColor
Label1.BackColor = temp
End Sub

When your event starts :
Timer1.Enabled =True

When your Event finishes:
Timer1.Enabled = False
Label1.ForeColor = vbButtonText
Label1.BackColor = vbButtonFace

This is untested and has no error checking, but it should get you started
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
you can flash a label with this in a timer also...

label1.visible=not label1.visible

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top