应该用不了这么多函数。简单改了一下,你试试:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("TEST", 394, 132, 192, 114)
$Input = GUICtrlCreateInput("", 112, 32, 121, 21)
$Input2 = GUICtrlCreateInput("", 112, 80, 121, 21, 0x0020)
$Button1 = GUICtrlCreateButton("保存", 256, 32, 75, 25)
$Button2 = GUICtrlCreateButton("重置", 256, 80, 75, 25)
$Label1 = GUICtrlCreateLabel("账号:", 80, 39, 30, 17)
$Label2 = GUICtrlCreateLabel("密码:", 80, 86, 30, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
BAOCUN()
;panduan()
;pand()
;quanbu()
Case $Button2
chongzhi()
EndSwitch
WEnd
Func BAOCUN()
$PUT1 = GUICtrlRead($Input)
$PUT2 = GUICtrlRead($Input2)
If $PUT1 <> '' And $PUT2 <> "" Then
MsgBox(64, "提示", "您的 账号为:" & $PUT1 & " 密码为:" & $PUT2 & " 如要修改请点重置!")
GUICtrlSetState($Input, $GUI_DISABLE)
GUICtrlSetState($Input2, $GUI_DISABLE)
Else
If $PUT1 = '' And $PUT2 = "" Then
MsgBox(64, "提示", "请填写账号和密码")
ElseIf $PUT1 <> '' Then
MsgBox(64, "提示", "请填写密码")
ElseIf $PUT2 <> '' Then
MsgBox(64, "提示", "请填写账号")
EndIf
EndIf
EndFunc ;==>BAOCUN
Func chongzhi()
GUICtrlSetState($Input, $GUI_ENABLE)
GUICtrlSetState($Input2, $GUI_ENABLE)
GUICtrlSetData($Input, "")
GUICtrlSetData($Input2, "")
MsgBox(64, "提示", "数据已重置!")
EndFunc ;==>chongzhi
|