Sign in to follow this  
Followers 0
blessthefall

Convert inputs into variables for use?

3 posts in this topic

I want to convert the entered input values into variables for use when the "OK" button is pressed.

This is as far as I've gotten with my limited knowledge:

#include <GUIConstants.au3>

$Test = GUICreate("Test", 241, 268, 397, 230)

$Input_a = GUICtrlCreateInput(0, 64, 72, 113, 21)

$Input_b = GUICtrlCreateInput(0, 64, 104, 113, 21)

$button = GUICtrlCreateButton("OK", 80, 144, 73, 25, 0)

GUISetState(@SW_SHOW)

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $button

EndSelect

Wend

Share this post


Link to post
Share on other sites



Use GUICtrlRead:

#include <GUIConstants.au3>

$Test = GUICreate("Test", 241, 268, 397, 230)

$Input_a = GUICtrlCreateInput(0, 64, 72, 113, 21)
$Input_b = GUICtrlCreateInput(0, 64, 104, 113, 21)

$button = GUICtrlCreateButton("OK", 80, 144, 73, 25, 0)

GUISetState(@SW_SHOW)


; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $button
    $String_a = GUICtrlRead($Input_a)
    $String_b = GUICtrlRead($Input_B)
    MsgBox(0,"","From input a: " & $String_a & @CRLF & "From input b: " & $String_B)

EndSelect
Wend

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites

Use GUICtrlRead:

#include <GUIConstants.au3>

$Test = GUICreate("Test", 241, 268, 397, 230)

$Input_a = GUICtrlCreateInput(0, 64, 72, 113, 21)
$Input_b = GUICtrlCreateInput(0, 64, 104, 113, 21)

$button = GUICtrlCreateButton("OK", 80, 144, 73, 25, 0)

GUISetState(@SW_SHOW)


; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $button
    $String_a = GUICtrlRead($Input_a)
    $String_b = GUICtrlRead($Input_B)
    MsgBox(0,"","From input a: " & $String_a & @CRLF & "From input b: " & $String_B)

EndSelect
Wend

You, sir, are awesome.

Thanks for your help. It's exactly what I wanted.

Cheers

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