Jump to content

Func Check Input Box


pro
 Share

Recommended Posts

I am creating a script :

Somebody fills his name and the script check if the input is filled and if so then it will send his name in a msgbox . If not it will give a msgbox that he first must fill de input name.

But I can't figure aout how to send his name in msgbox and how to let the script check the inputbox couldn't find in the forums or help files.

Could somebody help me .

In advanced THX

Pro

And sorry for my English

#include <GuiConstants.au3>
#include <Inet.au3>
#include <GUIConstantsEx.au3>

; GUI Creation
GuiCreate("Data", 500, 420)
GUICtrlCreateTabItem("Data")
$labelnaam = GUICtrlCreateLabel("Naam : ",60,40)
$Button_word = GUICtrlCreateButton("Opslaan",400,350)
$input_naam = GuiCtrlCreateInput("", 100, 40, 130, 20)
; GUI Show
GUISetState(@SW_SHOW)

While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $Button_word
         MsgBox(0, "Data", "Your name is $input_naam ")
                
        EndSelect
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Link to comment
Share on other sites

Like this...

#include <GuiConstants.au3>
#include <Inet.au3>
#include <GUIConstantsEx.au3>

; GUI Creation
GUICreate("Data", 500, 420)
GUICtrlCreateTabItem("Data")
$labelnaam = GUICtrlCreateLabel("Naam : ", 60, 40)
$Button_word = GUICtrlCreateButton("Opslaan", 400, 350)
$input_naam = GUICtrlCreateInput("", 100, 40, 130, 20)
; GUI Show
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button_word
            $read_input = GUICtrlRead($input_naam)
            MsgBox(0, "Data", "Your name is " & $read_input & "   ")

    EndSelect
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

8)

NEWHeader1.png

Link to comment
Share on other sites

Like this...

#include <GuiConstants.au3>
#include <Inet.au3>
#include <GUIConstantsEx.au3>

; GUI Creation
GUICreate("Data", 500, 420)
GUICtrlCreateTabItem("Data")
$labelnaam = GUICtrlCreateLabel("Naam : ", 60, 40)
$Button_word = GUICtrlCreateButton("Opslaan", 400, 350)
$input_naam = GUICtrlCreateInput("", 100, 40, 130, 20)
; GUI Show
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button_word
            $read_input = GUICtrlRead($input_naam)
            MsgBox(0, "Data", "Your name is " & $read_input & "   ")

    EndSelect
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

8)

THX for this now it show the name .

Now I am stiil searching for the function to check if the input is empty if it is so give message 'fill please your name' ?

Edited by pro
Link to comment
Share on other sites

try

If GUICTRLREAD($input_naam) = '' then
YOUR CODE
else
YOUR CODE
endif
Link to comment
Share on other sites

#include <GuiConstants.au3>
#include <Inet.au3>
#include <GUIConstantsEx.au3>

; GUI Creation
GUICreate("Data", 500, 420)
GUICtrlCreateTabItem("Data")
$labelnaam = GUICtrlCreateLabel("Naam : ", 60, 40)
$Button_word = GUICtrlCreateButton("Opslaan", 400, 350)
$input_naam = GUICtrlCreateInput("", 100, 40, 130, 20)
; GUI Show
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $Button_word
            Switch GUICtrlRead($input_naam)
                Case ""
                    MsgBox(0, "Data", "Please Fill in Your Name")
                Case Else
                    MsgBox(0, "Data", "Your name is " & $read_input & "   ")
            EndSwitch
        Case $GUI_EVENT_CLOSE 
            ExitLoop
    EndSwitch
WEnd

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

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