Blinking Label on Splash Screen

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I get a label (LoadingMessage) to blink on the Splash Screen until the
UserForm is unloaded?
 
In the userform


Private Sub CommandButton1_Click()
Unload Me
End Sub

Private Sub UserForm_Activate()
nTime = Now + TimeValue("00:00:01")
Application.OnTime nTime, "Flash"
End Sub

In a standard code module

Public nTime

Sub Flash()
If UserForm1.Label1.ForeColor = RGB(255, 0, 0) Then
UserForm1.Label1.ForeColor = RGB(0, 255, 0)
Else
UserForm1.Label1.ForeColor = RGB(255, 0, 0)
End If
nTime = Now + TimeValue("00:00:01")
Application.OnTime nTime, "Flash"
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
It works, but when the UserForm closes automatically per code in the
Initialize section, the label seems to still be blinking.

How do I get this flashing label to stop when the form is closed
automatically.
 
I am confused, if the form is closed, there is no label, so how can it
flash?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
I see it now, add this code to the form module


Private Sub UserForm_Terminate()
Application.OnTime nTime, "Flash", Schedule:=False
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top