本帖最后由 amxi 于 2011-11-27 13:37 编辑
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $login=False
$name="admin"
$pwd="123456"
GUISetFont(12,400,1,"微软雅黑")
$sForm=GUICreate(" 登录窗口 ",230,150)
$label=GUICtrlCreateLabel(" 用户登录",60,25,80,20)
$nlabel=GUICtrlCreateLabel("用户名",30,50,60,20)
$ninput=GUICtrlCreateinput("admin",90,50,110,20)
$plable1=GUICtrlCreateLabel("密 码",30,90,30,20)
$pinput=GUICtrlCreateinput("123456",90,80,110,20)
$Btn1=GUICtrlCreateButton(" 确定 ",100,120,50,25)
$Btn2=GUICtrlCreateButton(" 取消 ",165,120,50,25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While $login=False
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Btn1
_login()
GUIDelete($sform)
Case $Btn2
Exit
EndSwitch
WEnd
;GUIDelete($sform)
MsgBox(0,"","hahahaha")
Global $a,$b,$c,$d,$e
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate(" 主窗口 ", 801, 601, 0, 0)
GUISetState(@SW_SHOW)
while 1
$msg=GUIGetMsg()
Switch $msg
case $gui_event_close
Exit
EndSwitch
WEnd
Func _login() ;登录检测
if $name=GUICtrlRead($ninput) and $pwd=GUICtrlRead($pinput) Then
MsgBox(0,"成功","欢迎使用")
GUISetState(@sw_hide,$sform)
EndIf
EndFunc
密码框登录成成功后主窗体不显示,是哪里的问题?请教 |