How do you make the text flash in a textbox?
When an event adds text to a box, I'd like for it to flash..... Any easy way to do this?
Printable View
How do you make the text flash in a textbox?
When an event adds text to a box, I'd like for it to flash..... Any easy way to do this?
Flash? you mean like blinking?
That's easy, just add a timer with an interval of say, 1 second (1000 milliseconds)
Haven't test it, but it should workCode:'In the general declerations put:
Public orgstring as String
'In the sub you want to start the blinking put:
orgstring = Text1.Text
'In the timer event put
If Text1.Text = orgstring Then
Text1.Text = ""
Else
Text1.Text = orgstring
End If
Or you could try this,
it works the same, but it is a little less complicated, since it uses booleans :)
Code:Public strBlink As String
Dim blnEnable As Boolean
Private Sub Command1_Click()
strBlink = Text1.Text
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
blnEnable = Not blnEnable
If blnEnable = True Then
Text1.Text = ""
ElseIf blnEnable = fale Then
Text1.Text = orgstring
End If
End Sub
Would it matter if the text is being sent from the module to the textbox after a function is performed?