SkellySoul 3 Posted September 4, 2011 (edited) Hello In this script down is suppose to remain at 10 which it does but what I want to do is when I push up it will go all the way up to 20 and every time I push up $Limit gets -1. However if I push down it goes back up +1 So for example 10 is the min 20 is the max So 15 would be Input 15 and $Limit would = 5 If that makes sense, basically $Limit represents how many times you can go up or down Input = 20 , $Limit = 0 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate("") $Limit = GUICtrlCreateLabel("10" , 0, 100, 100, 20) $Stat = GUICtrlCreateInput("10", 0, 0, 50, 20) $Level = GUICtrlCreateUpdown($Stat) GUICtrlSetLimit($Level, GUICtrlRead($Stat) + GUICtrlRead($Limit), GUICtrlRead($Stat) + GUICtrlRead($Limit) - GUICtrlRead($Limit)) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch ToolTip(GUICtrlRead($Stat) , 0,0) WEnd Edited September 4, 2011 by SkellySoul Share this post Link to post Share on other sites
Rogue5099 18 Posted September 4, 2011 Something like this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate("") $Limit = GUICtrlCreateLabel("10" , 0, 100, 100, 20) $Stat = GUICtrlCreateInput("10", 0, 0, 50, 20) $Level = GUICtrlCreateUpdown($Stat) GUICtrlSetLimit($Level, 20, 10) GUISetState(@SW_SHOW) $CurrentLimit = GUICtrlRead($Stat) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch If $CurrentLimit <> GUICtrlRead($Stat) Then GUICtrlSetData($Limit, 20-GUICtrlRead($Stat)) $CurrentLimit = GUICtrlRead($Stat) EndIf WEnd 1 SkellySoul reacted to this My projects: Inventory / Mp3 Inventory, Computer Stats Share this post Link to post Share on other sites
SkellySoul 3 Posted September 4, 2011 Something like this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate("") $Limit = GUICtrlCreateLabel("10" , 0, 100, 100, 20) $Stat = GUICtrlCreateInput("10", 0, 0, 50, 20) $Level = GUICtrlCreateUpdown($Stat) GUICtrlSetLimit($Level, 20, 10) GUISetState(@SW_SHOW) $CurrentLimit = GUICtrlRead($Stat) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch If $CurrentLimit <> GUICtrlRead($Stat) Then GUICtrlSetData($Limit, 20-GUICtrlRead($Stat)) $CurrentLimit = GUICtrlRead($Stat) EndIf WEnd Yes, thank you Share this post Link to post Share on other sites