TimerInterval Property Example

The following example shows how to create a flashing button on a form by displaying and hiding an icon on the button. The form's Load event procedure sets the form's TimerInterval property to 1000 so the icon display is toggled once every second.

Sub Form_Load()
    Me.TimerInterval = 1000
End Sub

Sub Form_Timer()
    Static intShowPicture As Integer
    If intShowPicture Then
        ' Show icon.
        Me!btnPicture.Picture = "C:\Icons\Flash.ico"
    Else
        ' Don't show icon.
        Me!btnPicture.Picture = ""
    End If
    intShowPicture = Not intShowPicture
End Sub