Jump to content

how to use guictrlsetlimit


Recommended Posts

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?
Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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