satanttin Posted June 4, 2013 Share Posted June 4, 2013 Hello, I was trying to make an application to manage my hours very easily but i got stuck. everything i add hours it just adds 4 hours which is strange:O i wantit to be when i add 1 hours it add on and 10 hours 10 hours like it should be. and another question is that i want it to be automaticly refresh after i press the submit button. The code i have so far is: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $hours, $Input1 Opt("GUIOnEventMode", 1) Load() Func Load() $hours = IniRead (@ScriptDir & "\" & "uren.ini", "uren", "uren", "Error") Main() EndFunc Func main() $Form1 = GUICreate("Uren: Tijn Tinnenbroek", 545, 122, 192, 124) $Label1 = GUICtrlCreateLabel("Number of hours i worked: "& $hours, 8, 16, 528, 36) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("Input1", 184, 80, 73, 21) $Button1 = GUICtrlCreateButton("Add Hours", 256, 80, 75, 25) GUIctrlSetOnEvent($Button1, "Submit") GUISetOnEvent($GUI_EVENT_CLOSE, "Close") GUISetState() EndFunc While 1 Sleep(10) WEnd Func Close() Exit EndFunc Func Submit() $hours = $hours + $Input1 IniWrite (@ScriptDir & "\" & "uren.ini", "uren", "uren", $hours) EndFunc Hope someone can help me out:) Greetz. Link to comment Share on other sites More sharing options...
satanttin Posted June 4, 2013 Author Share Posted June 4, 2013 I found how the refresh/update works now just 1 problem left but can't figure that one out:( and it's the most important one xD Link to comment Share on other sites More sharing options...
Solution satanttin Posted June 4, 2013 Author Solution Share Posted June 4, 2013 $hours = $hours + GUICtrlRead($Input1) solved the problem :') 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