Results 1 to 2 of 2

Thread: Blinking of the background color of a textbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    Rijswijk, Holland
    Posts
    25

    Post

    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.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    This will flash it red 3 times

    Modify it to suit your needs

    Code:
    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

    [email protected]
    A BMW Group Company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width