Jump to content

Recommended Posts

Posted
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?
Posted (edited)

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

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

Posted

 

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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...