timmyc Posted January 14, 2014 Posted January 14, 2014 Hi All, This is like GUI 101 so extremely frustrating as i should know how to do this and the help file is not helping me. I have a button and an input box, Input box is set default to 0. When button is pressed i want whatever value is in the input box + 1 Its reconnizing the button click but not adding the +1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $button1 $button1 = GUICtrlRead($input1)+1 EndSwitch WEnd
lorenkinzel Posted January 14, 2014 Posted January 14, 2014 Case $Button1 oneMore() Func oneMore() $theNumber = GUICtrlRead($Input1) $theNumber +=1 GUICtrlSetData($Input1, $theNumber) EndFunc I'm pretty sure this is excessive, but easy to understand.
guestscripter Posted January 14, 2014 Posted January 14, 2014 Hi All, This is like GUI 101 so extremely frustrating as i should know how to do this and the help file is not helping me. I have a button and an input box, Input box is set default to 0. When button is pressed i want whatever value is in the input box + 1 Its reconnizing the button click but not adding the +1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $button1 $button1 = GUICtrlRead($input1)+1 EndSwitch WEnd this should fix it: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $button1 GUICtrlSetData($input1,GUICtrlRead($input1)+1) EndSwitch WEnd What you were doing before was only updating the variable $button1 each time. To update the input box GUICtrlSetData has to be used :-D case $button1 $button1 = GUICtrlRead($input1)+1 case $button1 GUICtrlSetData($input1,GUICtrlRead($input1)+1) ImageSearch15.au3 featuring _ImageSearchStartup() and _ImageSearchShutdown()
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