回复 1# cashiba
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Global $str,$str1,$str2
GUICreate("GUI", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1)
Local $idinput1 = GUICtrlCreateInput("", 10, 5, 300, 20)
Local $idinput2 = GUICtrlCreateInput("", 10, 35, 300, 20)
Local $idBtn = GUICtrlCreateButton("确定", 40, 75, 60, 20)
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idinput1
if GUICtrlRead($idinput1)=0 or GUICtrlRead($idinput1)="" Then
msgbox("","","input1值不能?空")
Else
$str1=GUICtrlRead($idinput1)
EndIf
Case $idinput2
if GUICtrlRead($idinput2)=0 or GUICtrlRead($idinput2)="" Then
msgbox("","","input2值不能?空")
Else
$str2=GUICtrlRead($idinput2)
EndIf
Case $idBtn
IF $str1="" or $str2="" Then
MsgBox($MB_SYSTEMMODAL, "有錯誤喔 請重新輸入","有錯誤喔 請重新輸入")
Else
$str= $str1&"||"&$str2
MsgBox($MB_SYSTEMMODAL, "?入值",$str)
EndIf
EndSwitch
WEnd
|