qzdisk 发表于 2011-12-9 10:34:37

关闭后自动询问

怎么能够让 用户在 点完这个按钮之后 弹出一个询问 然后点 是 或者 否 再执行其他操作呢?


请各位朋友帮帮忙!

sgj584520 发表于 2011-12-9 11:24:40

应该是再加一个条件语句吧

qzdisk 发表于 2011-12-9 11:26:55

怎么加呢点关闭的时候弹出来就好!

cxlater 发表于 2011-12-9 12:17:59

楼主看一下msgbox的返回值

lz888 发表于 2011-12-9 12:24:46

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 312, 197, 192, 114)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        $m = MsgBox(36, '提示', '你想干嘛')
                        Switch $m
                                Case 6
                                        MsgBox(0, 0, '你点击了是!')
                                Case 7
                                        MsgBox(0, 0, '你点击了否!')
                        EndSwitch
        EndSwitch
WEnd

雪栀 发表于 2011-12-9 12:25:24

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3 ;或者是$GUI_Event_Close
        Switch $msgbox = MsgBox(4,"title","content")
                Case 6
                        ;此处添加点击“是”后执行的语句
                Case 7
                        ;此处添加点击“否”后执行的语句
        EndSwitch
EndSwitch自己对应着把上面的代码插入到脚本里。

redapple2008 发表于 2011-12-9 13:15:27

没有明白楼主的意思!

chenronting 发表于 2011-12-9 13:34:55

回复 8# sliqi


    好好看看楼主问的问题,5、6楼的回答没有错吧,平心静气!

qzdisk 发表于 2011-12-9 13:57:52

回复qzdisk


   
5楼 6楼 给我好好的看看帮助去。
   
If MsgBox(1+64, "提示" , "确定要退出吗 ...
sliqi 发表于 2011-12-9 13:17 http://www.autoitx.com/images/common/back.gif

我们一般关掉程序都是 关右上角 那个打×用什么来判断 触发这个 msgbox这个函数!

shano 发表于 2011-12-9 14:44:57

我们一般关掉程序都是 关右上角 那个打×用什么来判断 触发这个 msgbox这个函数!
qzdisk 发表于 2011-12-9 13:57 http://www.autoitx.com/images/common/back.gif


    5 楼已经回答你了

au3x 发表于 2011-12-9 19:35:06

8#,我还没有看懂你的....但,我却测试了 5# 的 ,没错啊@!

nivisde 发表于 2011-12-9 20:26:38

OnAutoItExitRegister("Func_EXIT")
func Func_EXIT()
local $ifexit=msgbox(1,"提示","是否真要退出?")
if $ifexit=1 then
exit
else
XXXXXXXXXXXXXXXXX;不知道怎么写了
endfunc

cxlater 发表于 2011-12-9 20:34:27

回复 10# qzdisk
$GUI_EVENT_CLOSE

blue_dvd 发表于 2011-12-9 20:35:37

过来围观学习一下!

cxlater 发表于 2011-12-9 20:35:45

回复 13# nivisde

关闭GUI不等于退出Autoit
页: [1]
查看完整版本: 关闭后自动询问