Sign in to follow this  
Followers 0
Yaourth

GUICtrlSetLimit : use a variable instead of fix-value

2 posts in this topic

#1 ·  Posted (edited)

Hi all,

i just begin to code with Autoit and i try to make something really simple : use a variable in the GUICtrlSetLimit function.

Basically, I would like to have a changing max in an Updown control. So... this is the code :

$x_input=GUICtrlCreateInput("",60,45,50)

$x_up=GUICtrlCreateUpdown($x_input)

GUICtrlSetLimit($x_up,$max,6)

The $max variable is declared and when i put it in a label to check it, the value change as i want. But the CtrlSetLimit doesn't take it and the Max parameter stays at 0 (even when $max is set to another value). :whistle:

Where is the mistake.... may be could you help me...

Many thanks in advance and apologizes for my english... i hope my post is clear enough... :P

Edited by Yaourth

Share this post


Link to post
Share on other sites



There is no mistake here - if $max is declared and it has a value then it is working.

I've tested it using $max = 30 and it works.

see for yourself:

#include "GUIConstants.au3"

$title = "My GUI UpDown"
GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX)

$max = 30
$x_input=GUICtrlCreateInput("",60,45,50)
$x_up=GUICtrlCreateUpdown($x_input)
GUICtrlSetLimit($x_up,$max,6)
GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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  
Followers 0