回复 5# chengjinn
优化了一点点
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 341, 151)
$Input1 = GUICtrlCreateInput("", 56, 24, 233, 21)
$Button1 = GUICtrlCreateButton("Button1", 128, 72, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$temp=GUICtrlRead($Input1)
If $temp='' Then
MsgBox(0,0,'输入框不能为空', '', $Form1)
GUICtrlSetState($Input1, $gui_focus)
Else
MsgBox(0,0,$temp, '', $Form1)
EndIf
EndSwitch
WEnd
|