SkellySoul Posted September 4, 2011 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
Rogue5099 Posted September 4, 2011 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 SkellySoul 1 My projects: Inventory / Mp3 Inventory, Computer Stats
SkellySoul Posted September 4, 2011 Author 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
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