Jump to content
Sign in to follow this  
Queener

count

Recommended Posts

Queener

I'm not sure how I would say it, but it's more like a stop clock... I'm looking for a way to create 3 button and a label.

Button 1 = Start

Button 2 = Stop

Button 3 = Clear Count

Label = where the number starts (0 as starting)

As soon as I press Start the number starts to count from 0 to XXXXX. When I click stop; the count stops and it output that value onto excel sheet A1.

Help is much appreciated.


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites
water

Can you please post the code you've written so far?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Valuater

You should start with some code for us to help you. However this has been done numerous times before.... Just do a search in the top right hand corner.

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Queener

thats the thing;  I don't know where to start. I just need to know the part where it starts counting only. I don't want it to count as 00:00:00.


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites
water

Some code for you to play with:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>

Global $bCount = False, $iCount = 0
$Form = GUICreate("Counter", 187, 58, 974, 124)
$bStartStop = GUICtrlCreateButton("Start", 16, 16, 81, 25)
$Label = GUICtrlCreateLabel($iCount, 120, 22, 36, 16)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $bStartStop
            If $bCount = True Then
                $bCount = False
                GUICtrlSetData($bStartStop, "Start")
            Else
                $bCount = True
                GUICtrlSetData($bStartStop, "Stop")
            EndIf
    EndSwitch
    If $bCount = True Then
        $iCount = $iCount + 1
        GUICtrlSetData($Label, $iCount)
        Sleep(100)
    EndIf
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Queener

Interesting. I didn't know we can assign a single button as start and stop. Yep, it's what I'm looking for. Thanks a bunch.


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites
water

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×