[已解决] 如何退出GUI且又不退出程序?小弟跪求高手!!!
本帖最后由 linteyue 于 2011-2-24 16:23 编辑#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#NoTrayIcon
Opt("GUIOnEventMode", 1)
For $i = 1 To 5
_UpdateCKPOS()
Sleep(2000)
MsgBox(0,"",$i)
Next
Func _UpdateCKPOS()
$Version = "更新提示"
If WinExists($Version) <> 1 Then
AutoItWinSetTitle($Version)
$UPHint = GUICreate("更新提示", 270, 160, -1, -1, $WS_BORDER)
$Button1 = GUICtrlCreateButton("确 定", 80, 88, 99, 33)
;GUICtrlSetOnEvent($Button1, "OKButton")
GUICtrlSetOnEvent($Button1, "OKButton")
GUISetState(@SW_SHOW)
EndIf
EndFunc
Func OKButton()
Exit
EndFunc
上面脚本中,如何做到以下几点?,
1、脚本在弹出GUI窗口后,无论你是否点了GUI上的确定按键,都还继续循环;
2、在点击GUI上的确定按键后,只是退出GUI,并不是退出脚本;
上面脚本的问题是:
弹出GUI后,脚本不会再继续循环,而且按了确定后,又退出脚本了,,,,
求解。。。谢谢! 将窗口隐藏就可以啊,代码如下:#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#NoTrayIcon
Opt("GUIOnEventMode", 1)
For $i = 1 To 5
_UpdateCKPOS()
Sleep(2000)
MsgBox(0,"",$i)
Next
Func _UpdateCKPOS()
$Version = "更新提示"
If WinExists($Version) <> 1 Then
AutoItWinSetTitle($Version)
$UPHint = GUICreate("更新提示", 270, 160, -1, -1, $WS_BORDER)
$Button1 = GUICtrlCreateButton("确 定", 80, 88, 99, 33)
;GUICtrlSetOnEvent($Button1, "OKButton")
GUICtrlSetOnEvent($Button1, "OKButton")
GUISetState(@SW_SHOW)
EndIf
EndFunc
Func OKButton()
GUISetState(@SW_HIDE)
EndFunc Exit
改为
guidelete()
页:
[1]