Jump to content
Sign in to follow this  
mesale0077

GUICtrlCreateInput

Recommended Posts

mesale0077

hi

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("[#] Form1 [#]", 375, 232, 192, 124)

$Input1 = GUICtrlCreateInput("", 96, 32, 209, 21)

$Input2 = GUICtrlCreateInput("", 96, 80, 209, 21)

$Button1 = GUICtrlCreateButton("ok", 56, 160, 81, 41, $WS_GROUP)

$Button2 = GUICtrlCreateButton("exit", 160, 160, 89, 41, $WS_GROUP)

$Label1 = GUICtrlCreateLabel("─▒nput111", 40, 32, 45, 17)

$Label2 = GUICtrlCreateLabel("input222", 40, 80, 45, 17)

$Button3 = GUICtrlCreateButton("help", 288, 168, 65, 33, $WS_GROUP)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

$AD=GUICtrlRead($Input1)

$ANA=GUICtrlRead($Input2)

If stringlen($AD)=0 or stringlen($AD)=0 then msgbox(0,"please","Enter information")

;--------???????---->>>>>> $Input1 = GUICtrlCreateInput( or $Input2 = GUICtrlCreateInput( will control,If $Input1 = GUICtrlCreateInput or $Input2 = GUICtrlCreateInput ...empty, the process will not do

;$Input1 = GUICtrlCreateInput or $Input2 = GUICtrlCreateInput .. Was full of action will <<<<<----????--------

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

msgbox(0,"ok","press")

EndSwitch

WEnd

thank you

Share this post


Link to post
Share on other sites
Authenticity

Please use this -> Posted Image where posting AutoIt code. As much as I can understand, this:

If stringlen($AD)=0 or stringlen($AD)=0

perhaps should be:

If stringlen($AD)=0 or stringlen($ANA)=0

..but both will be empty as that is what you set them to.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 375, 232, 192, 124)
$Input1 = GUICtrlCreateInput("", 96, 32, 209, 21)
$Input2 = GUICtrlCreateInput("", 96, 80, 209, 21)
$Button1 = GUICtrlCreateButton("ok", 56, 160, 81, 41, $WS_GROUP)
$Button2 = GUICtrlCreateButton("exit", 160, 160, 89, 41, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("?nput111", 40, 32, 45, 17)
$Label2 = GUICtrlCreateLabel("input222", 40, 80, 45, 17)
$Button3 = GUICtrlCreateButton("help", 288, 168, 65, 33, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $AD = GUICtrlRead($Input1)
            $ANA = GUICtrlRead($Input2)
            If StringLen($AD) = 0 Or StringLen($ANA) = 0 Then MsgBox(0, "please", "Enter information")
            ; do rest of OK job...
            MsgBox(0, "ok", "press")
    EndSwitch
WEnd
Edited by Authenticity

Share this post


Link to post
Share on other sites
mesale0077

like it

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

_Myname()

Func _Myname()

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("[#] Form1 [#]", 375, 232, 192, 124)

$Input1 = GUICtrlCreateInput("", 96, 32, 209, 21)

$Input2 = GUICtrlCreateInput("", 96, 80, 209, 21)

$Button1 = GUICtrlCreateButton("ok", 56, 160, 81, 41, $WS_GROUP)

$Button2 = GUICtrlCreateButton("exit", 160, 160, 89, 41, $WS_GROUP)

$Label1 = GUICtrlCreateLabel("?nput111", 40, 32, 45, 17)

$Label2 = GUICtrlCreateLabel("input222", 40, 80, 45, 17)

$Button3 = GUICtrlCreateButton("help", 288, 168, 65, 33, $WS_GROUP)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

$AD = GUICtrlRead($Input1)

$ANA = GUICtrlRead($Input2)

If StringLen($AD) = 0 Or StringLen($ANA) = 0 Then Myname()

; do rest of OK job...

MsgBox(0, "ok", "press")

EndSwitch

WEnd

EndFunc

Func Myname()

MsgBox(0, "please", "Enter information")

GUIDelete()

_Myname()

EndFunc

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.