Sign in to follow this  
Followers 0
Phil Viton

non-working UpDown

3 posts in this topic

I'm just starting to write AutoIt scripts, but could someone tell me what's wrong with the UpDown control

in the code below? It's based pretty much on the example in the documentation; it looks

fine; but I can't actually increase/or decrease the value; and once I move off it, I can't select it again.

Thanks!

========== code

#include <GuiConstants.au3>

;create the GUI

GuiCreate("Run Web2c",300,150,400,300)

GuiCtrlCreateLabel("LaTeX passes: ",10,50,140)

$passlatex = GuiCtrlCreateInput("2",90,50,40)

$updown=GuiCtrlCreateUpDown($passlatex)

GuiCtrlSetLimit($updown,1,4)

$okbutton = GuiCtrlCreateButton("OK",10,120,50)

$cancelbutton = GuiCtrlCreateButton("Cancel",70,120,50)

; put up the GUI

GUISetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $okbutton

; get the data

$passes=GuiCtrlRead($updown)

ExitLoop

Case $msg = $cancelbutton

$msg = $GUI_EVENT_CLOSE

EndSelect

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

====== end code

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe this:

GuiCtrlCreateLabel("LaTeX passes: ",10,50,140)

overlaps your $passlatex and $updown - controls.

Just reduce the width (140) of the label a little bit, cause you input control starts at coords: 90.

I.e.: GuiCtrlCreateLabel("LaTeX passes: ",10,50,80)

80 is maximum, cause 10 + 80 = 90 -> where the input starts.

Edited by Holger

Share this post


Link to post
Share on other sites

Yes, that was exactly right - thanks for the immediate feedback!

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