PDA

Click to See Complete Forum and Search --> : Blinking of the background color of a textbox


ingrid
Nov 10th, 1999, 05:18 PM
Dear VB programmers,

VB 5 question:

Is there any possibillity to let the background color blinking of textbox??

If yes: how do I do that?

if no: thanks for reading!

ingrid.

Mark Sreeves
Nov 10th, 1999, 05:28 PM
This will flash it red 3 times

Modify it to suit your needs


Public Sub FlashControl(C As Control)
'/// ====================================================================
'/// By : Mark Sreeves
'/// Started : 27/04/99
'/// Description :
'/// Parameters :
'/// Depends on :
'/// Side Effects : None
'/// Notes :
'/// ====================================================================

'this flashes the background colour of the control to draw the users attention to it
Dim OldColor As Double
Dim Delay As Double
Dim X As Integer

On Error Resume Next

OldColor = C.BackColor
For X = 1 To 3
C.BackColor = QBColor(12)
Delay = Timer
While Timer - Delay < 0.2
DoEvents
Wend
C.BackColor = OldColor
Delay = Timer
While Timer - Delay < 0.2
DoEvents
Wend
Next X

End Sub



------------------
Mark Sreeves
Analyst Programmer

Mark.Sreeves@Softlab.co.uk
A BMW Group Company