Option
Explicit
Private
mblnRun
As
Boolean
Private
Sub
TextBox1_Change()
If
TextBox1.Value =
"x"
Then
Call
Blinker
Else
mblnRun =
False
End
If
End
Sub
Private
Sub
TextBox1_KeyUp(
ByVal
KeyCode
As
MSForms.ReturnInteger,
ByVal
Shift
As
Integer
)
If
TextBox1.Value <>
"x"
Then
mblnRun =
False
End
Sub
Private
Sub
UserForm_Terminate()
mblnRun =
False
End
Sub
Private
Sub
Blinker()
Dim
sngTimer
As
Single
Dim
sngOn_Time
As
Single
Dim
sngOff_Time
As
Single
Dim
lngOn_Color
As
Long
Dim
lngOff_Color
As
Long
sngOn_Time = 0.5
lngOn_Color = vbRed
sngOff_Time = 0.5
lngOff_Color = vbWhite
mblnRun =
True
Do
While
mblnRun
TextBox1.BackColor = lngOn_Color
sngTimer = Timer:
Do
While
Timer < sngTimer + sngOn_Time: DoEvents:
Loop
TextBox1.BackColor = lngOff_Color
sngTimer = Timer:
Do
While
Timer < sngTimer + sngOff_Time: DoEvents:
Loop
Loop
End
Sub