Consulting

Results 1 to 3 of 3

Thread: Can I make a border flash ?

  1. #1

    Lightbulb Can I make a border flash ?

    I have a tick box and when its pressed i want its border to flash red three times just as a nice feature to highlight to the user they have ticked the box.

    This is my current code:

    Private Sub FlagSection3_Click()
    If FlagSection3.Value = True Then
    flag3.Text = "Section 3"
    End If
    If FlagSection3.Value = False Then
    flag3.Text = ""
    End If
    End Sub

    I just want to add code (maybe using a timer) to make the border go from transparent to red to transpartent to red a few times. thanks for any help. ive tried to work out how to do it but.....

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    Personally I find bells and whistles of this nature annoying. I don't know what border you are talking about, however you can make a checkbox (or tickbox) caption flash using:

    [vba]Option Explicit
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Sub CheckBox1_Change()
    Dim strCap As String
    strCap = Me.CheckBox1.Caption
    If Me.CheckBox1 Then
    Me.CheckBox1.Caption = ""
    Pause 100
    Me.CheckBox1.Caption = strCap
    Pause 100
    Me.CheckBox1.Caption = ""
    Pause 100
    Me.CheckBox1.Caption = strCap
    Pause 100
    Me.CheckBox1.Caption = ""
    Pause 100
    Me.CheckBox1.Caption = strCap
    End If
    End Sub
    Sub Pause(ByVal lngPeriod As Long)
    DoEvents
    Sleep lngPeriod
    End Sub
    [/vba]

    P.S. It helps when you come back to post new questions if you will respond and acknowledge the answers provided to earlier posts.
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    I have a tick box and when its pressed i want its border to flash red three times just as a nice feature to highlight to the user they have ticked the box.
    I have to agree with Greg. I find flashing anything annoying, and personally, something flashing to let me know I just did something...rather insulting. If I just clicked the box, I do not need something flashing to tell me I just clicked the box. What? I am an idiot? I have serious short term memory problems?

    If someone gave me a document with a flashing border (or caption, or anything), the first thing I would do is hack it and turn the darn thing off.

Posting Permissions

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