Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Blink Text (2002/xp)

    Can anyone give me the code?/ information on how to make text flash (or blink) on a form.
    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Blink Text (2002/xp)

    Blinking text is rarely a good idea - it becomes irritating very soon, and it can be dangerous to users with epileptic tendencies.

    If you still want to use it, here is a method to let a label lblBlink flash; it can be easily be adapted for a text box.
    - Set the Timer Interval property of the form to the number of milliseconds between changing the text color, e.g. 200 for 200 ms = 0.2 seconds.
    - Create an event procedute for the On Timer event of the form:

    Private Sub Form_Timer()
    With Me.lblBlink
    If .ForeColor = vbWhiteThen
    .ForeColor = vbBlack
    Else
    .ForeColor = vbWhite
    End If
    End With
    End Sub

    You can use other colors, of course.
    You can turn blinking off by setting Me.TimerInterval to 0, and restart it by setting Me.TimerInterval to a non-zero value.

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Blink Text (2002/xp)

    BTW, that's no joke about the possible adverse consequences of flashing text, etc on those users who may be susceptible to seizures. In its User Interface and Accessibility guidelines for developers, Microsoft acknowledges this issue. For example, see this MSDN article:

    MSDN Library - Flashing User Interface and the GetCaretBlinkTime Function

    Brief quote: "Microsoft recommends that applications keep screens, text, objects, and other elements from flickering, flashing, or pulsating." And: "Applications with custom controls should share the same system-wide cursor flash rate. Otherwise, a different blink rate for different cursors or other user interface (UI) elements may not only confuse the user, but could possibly contribute to causing seizures as well."

    (Emphasis added.) So for all you would-be "flashers" out there, recommend reconsider use of this questionable technique. Besides, as HansV has noted, this type of "feature" quickly wears out its welcome, and becomes highly annoying for most users of an application.

    HTH

  4. #4
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blink Text (2002/xp)

    I'm convinced. I guess I'll have to bold the text and hope that the user will see it.
    Thanks for the info.

Posting Permissions

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