Queener Posted October 30, 2013 Share 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.") Link to comment Share on other sites More sharing options...
water Posted October 30, 2013 Share Posted October 30, 2013 Can you please post the code you've written so far? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Valuater Posted October 30, 2013 Share 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) Link to comment Share on other sites More sharing options...
Queener Posted October 30, 2013 Author Share 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.") Link to comment Share on other sites More sharing options...
Solution water Posted October 30, 2013 Solution Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Queener Posted October 30, 2013 Author Share 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.") Link to comment Share on other sites More sharing options...
water Posted October 30, 2013 Share Posted October 30, 2013 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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