PDA

View Full Version : Can I make a border flash ?



carlbowles10
07-04-2012, 07:02 AM
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..... :banghead:

gmaxey
07-04-2012, 08:44 AM
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:

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


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

fumei
07-05-2012, 04:55 PM
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.