Jump to content
Sign in to follow this  
rotatorkuf

how to use guictrlsetlimit

Recommended Posts

rotatorkuf
Global $inputRuns = GUICtrlCreateInput("3",10, 110, 40,20)
GUICtrlCreateUpdown($inputRuns)
GUICtrlSetLimit($inputRuns, 20, 6)
 
So i want the updown to stop at 20 and 6 for max/min, but whenever i load up the gui/script, it goes past those values.
 
What am I doing wrong?

Share this post


Link to post
Share on other sites
kylomas

rotatorcuff,

GuiCtrlSetLimit needs to reference the updown control.  Try it like this...

#include <GUIConstantsEx.au3>

local $gui010 = guicreate('')
Global $inputRuns = GUICtrlCreateInput("3",10, 110, 40,20)
local $up = GUICtrlCreateUpdown($inputRuns)
GUICtrlSetLimit($up, 20, 6)
guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            Exit
    EndSwitch
WEnd

kylomas

edit: This also works...

#include <GUIConstantsEx.au3>

local $gui010 = guicreate('')
Global $inputRuns = GUICtrlCreateInput("3",10, 110, 40,20)
GUICtrlCreateUpdown($inputRuns)
GUICtrlSetLimit(-1, 20, 6)
guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            Exit
    EndSwitch
WEnd
Edited by kylomas
  • Like 1

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
rotatorkuf

 

rotatorcuff,

GuiCtrlSetLimit needs to reference the updown control.  Try it like this...

#include <GUIConstantsEx.au3>

local $gui010 = guicreate('')
Global $inputRuns = GUICtrlCreateInput("3",10, 110, 40,20)
local $up = GUICtrlCreateUpdown($inputRuns)
GUICtrlSetLimit($up, 20, 6)
guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            Exit
    EndSwitch
WEnd

kylomas

edit: This also works...

#include <GUIConstantsEx.au3>

local $gui010 = guicreate('')
Global $inputRuns = GUICtrlCreateInput("3",10, 110, 40,20)
GUICtrlCreateUpdown($inputRuns)
GUICtrlSetLimit(-1, 20, 6)
guisetstate()

while 1
    switch guigetmsg()
        case $gui_event_close
            Exit
    EndSwitch
WEnd

thank you so much, i'm dumb lol

Share this post


Link to post
Share on other sites
kylomas

No, not dumb, just inexperienced.  Please see my sig for how to post code.

Good luck and Welcome to AutoIt,

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.