derkaderka Posted November 30, 2010 Share Posted November 30, 2010 I made an application in AutoIT that calculates change in time. Here is the code: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region $Form1 = GUICreate("Change In Time", 401, 123, 192, 124) $Input1 = GUICtrlCreateInput("", 16, 16, 41, 21) $Input2 = GUICtrlCreateInput("", 16, 48, 41, 21) $Input3 = GUICtrlCreateInput("", 144, 16, 41, 21) $Input4 = GUICtrlCreateInput("", 144, 48, 41, 21) $Label1 = GUICtrlCreateLabel("Hours", 64, 18, 40, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Minutes", 64, 50, 58, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("Hours", 192, 18, 40, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel("Minutes", 192, 50, 58, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Calculate", 168, 88, 75, 25) $Group1 = GUICtrlCreateGroup("Start", 8, 0, 121, 81) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("End", 136, 0, 121, 81) GUICtrlCreateGroup("", -99, -99, 1, 1) $Input5 = GUICtrlCreateInput("", 280, 16, 41, 21) $Input6 = GUICtrlCreateInput("", 280, 48, 41, 21) $Label5 = GUICtrlCreateLabel("Hours", 328, 18, 40, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label6 = GUICtrlCreateLabel("Minutes", 328, 50, 58, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Group3 = GUICtrlCreateGroup("Output", 272, 0, 121, 81) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $hourread2 = GUICtrlRead($Input3) $hourread1 = GUICtrlRead($Input1) $minutesread2 = GUICtrlRead($Input4) $minutesread1 = GUICtrlRead($Input2) $finalhours = $hourread2 - $hourread1 If $minutesread1>$minutesread2 Then $finalhours -=1 $minutesread2 +=60 EndIf $minutesfinal = $minutesread2 - $minutesread1 GUICtrlSetData($Input5, $finalhours) GUICtrlSetData($Input6, $minutesfinal) EndSwitch WEnd I am trying to do the same thing in C Sharp, can anybody help me with this? Link to comment Share on other sites More sharing options...
Fubarable Posted November 30, 2010 Share Posted November 30, 2010 The process to do this in C# is completely different than in AutoIt, for one you'd be using a time-specific class, possibly the DateTime class, getting time info by calling the static now method,... but why ask here? why not on a C# forum? Link to comment Share on other sites More sharing options...
derkaderka Posted December 1, 2010 Author Share Posted December 1, 2010 I don't know any c# forums. Are there any good ones? Link to comment Share on other sites More sharing options...
JohnOne Posted December 1, 2010 Share Posted December 1, 2010 Try getting your post moved to the chat forum, but it just looks like simple addition and subtraction to me, whats your problem with conversion? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
derkaderka Posted December 2, 2010 Author Share Posted December 2, 2010 Well I want to be able to display hours and minutes, if I convert to minutes, I would have to find some way of converting back to hours and minutes. Normally you would do this by dividing and finding the remainder. However I am not aware of any script/program that can do that, and if they can, how? Link to comment Share on other sites More sharing options...
Steveiwonder Posted December 2, 2010 Share Posted December 2, 2010 (edited) ignore Edited December 2, 2010 by Steveiwonder They call me MrRegExpMan 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