View Single Post
 
Old 09-15-2018, 05:25 PM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

.

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


Attached Images
File Type: jpg Timer.jpg (132.0 KB, 26 views)
Attached Files
File Type: xlsm EXCEL BINGO PROGRAM Sep 5 20181.xlsm (26.0 KB, 9 views)
File Type: xlsm Ten Sec Countdown In Form.xlsm (26.6 KB, 12 views)
Reply With Quote