Jump to content

Recommended Posts

Posted

GuiCtrlCreateLabel("X", 10, 10)

$xcoord = GuiCtrlCreateInput("246", 20, 5, 50 ) ; creates the input.

GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

GuiCtrlCreateLabel("Y", 10, 40)

$ycoord = GuiCtrlCreateInput("243", 20, 35, 50 ) ; creates the input.

GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

GuiCtrlCreateLabel("X2", 5, 70)

$x2coord = GuiCtrlCreateInput("215", 20, 65, 50 ) ; creates the input.

GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

GuiCtrlCreateLabel("Y2", 5, 100)

$y2coord = GuiCtrlCreateInput("231", 20, 95, 50 ) ; creates the input.

GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

Will the variables $ycoord and such return the value thats inputed? Because it doesnt seem like its doing that:(
Posted (edited)

maybe

#include <GUIConstants.au3>

GUICreate("MY GUI")


GuiCtrlCreateLabel("X", 10, 10)
$xcoord = GuiCtrlCreateInput("246", 20, 5, 50 ) ; creates the input.
GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

GuiCtrlCreateLabel("Y", 10, 40)
$ycoord = GuiCtrlCreateInput("243", 20, 35, 50 ) ; creates the input.
GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

GuiCtrlCreateLabel("X2", 5, 70)
$x2coord = GuiCtrlCreateInput("215", 20, 65, 50 ) ; creates the input.
GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

GuiCtrlCreateLabel("Y2", 5, 100)
$y2coord = GuiCtrlCreateInput("231", 20, 95, 50 ) ; creates the input.
GuiCtrlCreateUpDown(-1) ; sets the input as an up-down control.

$button = GUICtrlCreateButton( " chek values ", 100, 300, 120, 30)

GUISetState()

While 1
    
    $msg = GUIGetMsg()
    
    if $msg = $GUI_EVENT_CLOSE Then Exit
        
    If $msg = $button Then
        
        $x = GUICtrlRead($xcoord)
        $y = GUICtrlRead($ycoord)
        $x2 = GUICtrlRead($x2coord)
        $y2 = GUICtrlRead($y2coord)
        MsgBox(64, "Value x", "x = " & $x)
    EndIf
        
WEnd

8)

Edited by Valuater

NEWHeader1.png

Posted (edited)

Boot up your helpfile and look up any GUICtrlCreat*-function. You will see that they return

something called a controlID. $ycoord will not return the value inputted in the control but

instead it will return these IDs mentioned which can be used to read, write, delete, hide,

modify and more using other functions mentioned in the helpfile.

So, to read the value of your inputbox, just look at the first line in the remarks-section for

GUICtrlCreateInput where the answer will be waiting for you. I know I could just say it to

you but that's so boring :nuke:

Edit : A little bit late but I just noticed...why is this in the v2-forum ? :P

Edited by Helge
  • Recently Browsing   0 members

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