Bert Posted January 11, 2006 Share Posted January 11, 2006 (edited) I made a simple input box: $Wgroup4 = GUICtrlCreateGroup("Reboot",215, 156, 225,75) $inireboot1 = iniread("config\config.ini", "Config", "RebootTimer", "15") $Wreboot1 = GUICtrlCreateinput("", 220, 180, 35, 20, 0x2000) GUICtrlSetData($Wreboot1,$inireboot1,15) GUICtrlSetTip(-1, "This is the amount of seconds" & @CRLF &"before the system will reboot"& @CRLF &"after all applications are processed.") $Wreboot2 = GUICtrlCreateUpdown($Wreboot1) GUICtrlSetLimit($Wreboot1, 2, 1) GUICtrlCreatelabel("Reboot Timeout",259, 183) My question is this: I want to limit the range of the up - down scrolling from 1 to 99. If the scroll reaches 99 or 1, it stops unless you start scrolling the other way. I will allow the user to type something in, but I want the same range limit imposed. Any thoughts? Edited January 12, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted January 12, 2006 Author Share Posted January 12, 2006 anyone? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted January 12, 2006 Author Share Posted January 12, 2006 (edited) I know I can use GUICtrlSetLimit to to limit the max number of characters that can be entered. I can limit it to 2. The problem is When scrolling down, I can get into negative numbers. This is something I like to avoid. Edited January 12, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted January 12, 2006 Author Share Posted January 12, 2006 anyone at all??????? please? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 12, 2006 Moderators Share Posted January 12, 2006 anyone at all??????? please? Anyone at all... or someone with an answer that will work for you? ... I haven't used the commands your talking about, so I'm the 'Anyone at all', just not the 'Anyone with the answer' Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted January 12, 2006 Share Posted January 12, 2006 its easier for us if you create the example like this #include <GuiConstants.au3> GUICreate("Test GUI") $Wgroup4 = GUICtrlCreateGroup("Reboot", 215, 156, 225, 75) $inireboot1 = IniRead("config\config.ini", "Config", "RebootTimer", "15") $Wreboot1 = GUICtrlCreateInput("", 220, 180, 35, 20, 0x2000) GUICtrlSetData($Wreboot1, $inireboot1, 15) GUICtrlSetTip(-1, "This is the amount of seconds" & @CRLF & "before the system will reboot" & @CRLF & "after all applications are processed.") $Wreboot2 = GUICtrlCreateUpdown($Wreboot1) GUICtrlSetLimit($Wreboot1, 2, 1) GUICtrlSetLimit($Wreboot2, 99, 1) GUICtrlCreateLabel("Reboot Timeout", 259, 183) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit WEnd this has your answer also 8) Link to comment Share on other sites More sharing options...
Rad Posted January 12, 2006 Share Posted January 12, 2006 $dmg_armorlabel=GUICtrlCreateLabel("Armor:", 38,142,32,18) $dmg_armorbutton=GuiCtrlCreateInput("0",70,140,48,20,BitOr(20,$ES_NUMBER),0x2001) $dmg_armorscroll=GuiCtrlCreateUpDown($dmg_armorbutton) GUICtrlSetLimit($dmg_armorscroll,100,-10) Thats what Im using in my program, I have a problem too, though. For some reason when you scroll into negatives instead of saying "-10", "-5" it says "5-" and "10-" How do you fix that? Link to comment Share on other sites More sharing options...
Valuater Posted January 12, 2006 Share Posted January 12, 2006 i just tried it and it worked for me #include <GuiConstants.au3> GUICreate("Test GUI") $dmg_armorlabel=GUICtrlCreateLabel("Armor:", 38,142,32,18) $dmg_armorbutton=GuiCtrlCreateInput("0",70,140,48,20,BitOr(20,$ES_NUMBER),0x2001) $dmg_armorscroll=GuiCtrlCreateUpDown($dmg_armorbutton) GUICtrlSetLimit($dmg_armorscroll,100,-10) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit WEnd 8) Link to comment Share on other sites More sharing options...
Rad Posted January 12, 2006 Share Posted January 12, 2006 (edited) Nope doesnt work (still) Edited January 12, 2006 by Rad Link to comment Share on other sites More sharing options...
Bert Posted January 12, 2006 Author Share Posted January 12, 2006 I thought I did ok with the example. My bad. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Rad Posted January 12, 2006 Share Posted January 12, 2006 Ahha, 0x2001 - remove that and it displays on the left side (the - that is) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 12, 2006 Moderators Share Posted January 12, 2006 I changed the GUICtrlSetLimit($dmg_armorscroll,100,-10) to GUICtrlSetLimit($dmg_armorscroll,100,1) and it did exactly as vollyman asked... went from 1 to 100 or 100 to 1 nothing above or below... Nice job Val! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Bert Posted January 12, 2006 Author Share Posted January 12, 2006 (edited) Ok, I see what you did. I had the GUICtrlSetLimit tied to GuiCtrlCreateInput, not GuiCtrlCreateUpDown. The function reference wasn't very clear, and that is why I was having trouble. In what is listed as related it gives GuiCtrlCreateList, GuiCtrlCreateInput, and GuiCtrlCreateEdit. It should say GuiCtrlCreateUpDown as one of the choices. Thanks Val for the fix. @ Smoke: I dub you "anyone at all" heheh Edited January 12, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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