Sign in to follow this  
Followers 0
BulletMonk

Type Field

6 posts in this topic

Sorry for posting in the wrong forum before.

How do I make a field for people to type a word in?

And what is the script to make that word appear in my nect msgbox?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Local $MyVariable = InputBox('Question', 'What is your name?')
MsgBox(64, 'Message', 'Your name is ' & $MyVariable & '.')

Edit: The InputBox() has a Cancel button and you might want to (e.g.) exit your script if the user clicks it. Here's how:

Local $MyVariable = InputBox('Question', 'What is your name?')
If @Error Then Exit
MsgBox(64, 'Message', 'Your name is ' & $MyVariable & '.')
Edited by LxP

Share this post


Link to post
Share on other sites

Thanks once again.

Share this post


Link to post
Share on other sites

if you want to do it using a gui try this 1:

#include<guiconstants.au3>; include this to make a gui
$main = guicreate ("Main window", 200, 100); create the main window of the gui
$input = guictrlcreateinput ("", 10, 10, 180); here is your inputfield
$button = guictrlcreatebutton ("Action", 10, 40, 180); the button for an interaction
guisetstate(); to let someone see the gui

while 1; for infinte loop
$msg = guigetmsg(); to find out if the something happens in the gui, e.g. button pressed
select; mutiple options
case $msg = $GUI_EVENT_CLOSE; to detect if someone hits the X to close the window
exit; then exit the script
case $msg = $button; someone pushed the button
msgbox (0, "Message", "You typed " & guictrlread($input)); messagebox - title:Message - text: You typed & whatever is in the input
endselect; for ending the select
wend; for ending the whileloop

the script can only be exited with the X-button

longer version as LxP did but i like that 1 more

ok it's not that easy

good luck with your script

btw what do you need that for?

Share this post


Link to post
Share on other sites

Nothing really.I'm just trying out all sorts of simple scripts..can't say the one you posted is simple =)).

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