Queener Posted October 30, 2013 Posted October 30, 2013 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.")
water Posted October 30, 2013 Posted October 30, 2013 Can you please post the code you've written so far? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Valuater Posted October 30, 2013 Posted October 30, 2013 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)
Queener Posted October 30, 2013 Author Posted October 30, 2013 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.")
Solution water Posted October 30, 2013 Solution Posted October 30, 2013 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Queener Posted October 30, 2013 Author Posted October 30, 2013 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.")
water Posted October 30, 2013 Posted October 30, 2013 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now