Jump to content

Can't Seem To Set GuiInput to Variable


Recommended Posts

Need more detail, why the guictrlread?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example1()

; example 1
Func Example1()
    Local $msg, $ci0
    Local $a = 10;<-- Some value

    GUICreate("My GUI",300,300) ; will create a dialog box that when displayed is centered
    $ci0=GUICtrlCreateInput($a,20,30,100,20)
    GUISetState(@SW_SHOW)     ; will display an empty dialog box

   ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
EndFunc  ;==>Example1
Link to comment
Share on other sites

Need more detail, why the guictrlread?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example1()

; example 1
Func Example1()
    Local $msg, $ci0
    Local $a = 10;<-- Some value

    GUICreate("My GUI",300,300); will create a dialog box that when displayed is centered
    $ci0=GUICtrlCreateInput($a,20,30,100,20)
    GUISetState(@SW_SHOW)    ; will display an empty dialog box

  ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
EndFunc ;==>Example1
I'm writing a script that will use ShellExecute to send URL's in order to automate commands in a browser-game, the only variable in those URL's is the CityID which I will ask for from the user and combine that input with the rest of the URL.
Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $msg, $ci0
Global $a = 10;<-- Some value

GUICreate("My GUI", 300, 300); will create a dialog box that when displayed is centered
$ci0 = GUICtrlCreateInput($a, 20, 30, 100, 20)
$button = GUICtrlCreateButton("Start",20,60,100,20)
GUISetState(@SW_SHOW); will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    If $msg = $button Then
        MsgBox(0,"",GUICtrlRead($ci0))
    EndIf
WEnd
GUIDelete()

works fine, or didn'nt I understand the real problem?

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...