.
Downloads at bottom ...
Timer code :
Code:
Option Explicit
Sub BtnRaz_Click()
mTimer3.TimerOff
LblTemps.Caption = "00:00:10"
With TButton1
.Caption = "Start"
.ForeColor = &H8000&
.Value = False
End With
End Sub
Sub TimerStart()
With TButton1
If .Value = True Then
.Caption = "Stop"
.ForeColor = &H80&
mTimer3.TimerOn 1000
Else
.Caption = "Start"
.ForeColor = &H8000&
mTimer3.TimerOff
End If
End With
End Sub
Private Sub TButton1_Click()
TimerStart
End Sub
Private Sub UserForm_Initialize()
Application.WindowState = xlMinimized
With TButton1
.Caption = "Start"
.ForeColor = &H8000&
.Value = False
End With
Const C_VBA6_USERFORM_CLASSNAME = "ThunderDFrame"
Dim ret As Long
Dim formHWnd As Long
'Get window handle of the userform
formHWnd = FindWindow(C_VBA6_USERFORM_CLASSNAME, Me.Caption)
If formHWnd = 0 Then
Debug.Print Err.LastDllError
End If
'Set userform window to 'always on top'
ret = SetWindowPos(formHWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
If ret = 0 Then
Debug.Print Err.LastDllError
End If
End Sub
Private Sub UserForm_Terminate()
Application.WindowState = xlNormal
mTimer3.TimerOff
Unload Me
End Sub