找回密码
 加入
搜索
查看: 3797|回复: 10

[AU3基础] [已解决] 新手提个问题。 在线等。。。。

    [复制链接]
发表于 2010-3-5 15:00:54 | 显示全部楼层 |阅读模式
本帖最后由 tzz365 于 2010-3-5 16:48 编辑


第二个GUI你好世界。
点取消, 不关闭倒计时。 只退出第二个GUI如何做到。
$Label1 = GUICtrlCreateLabel("30秒后机器重启进入超级状态!", 1, 50, 400, 28)
GUICtrlSetFont(-1, 12, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Button2
                        Exit
                Case $Button1
GUICreate("你好世界", 200, 100)
GUICtrlCreateLabel("你好世界!你好么?", 30, 10)
$okbutton1 = GUICtrlCreateButton("取消", 20, 50, 60)
$okbutton2 = GUICtrlCreateButton("确定", 120, 50, 60)
GUISetState(@SW_SHOW)

While 1
  $msg = GUIGetMsg()

  Select
    Case $msg = $okbutton1
exit(0)
    Case $msg = $okbutton2
$okbutton2 = $Button1
      ExitLoop
  EndSelect
WEnd
                        ExitLoop
exit
        EndSwitch
        If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
        $time -= 1
        GUICtrlSetData($Label1, $time & "秒后机器重启进入超级状态!")
        GUICtrlSetData($Progress1, (30 - $time) / 0.3)
        If $time <= 0 Then AdlibUnRegister()
EndFunc   ;==>_timer

Func main()
Run("D:\Program Files\Tencent\QQ\Bin\QQ.exe");启动qq

EndFunc   ;==>main
 

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-3-5 15:30:21 | 显示全部楼层
绕口令哦,真绕
 楼主| 发表于 2010-3-5 15:34:39 | 显示全部楼层
确定按扭。  点下有在次确定和取消。  AU3应该怎么去实现?

简单来说就是这样。
发表于 2010-3-5 15:41:41 | 显示全部楼层
你那个执行重启进入超级状态的命令写在那个MSGBOX里面就好了吧,
$ch1 = MsgBox(257,"你好世界","你好世界!你好吗?")
if $ch1 = 1 then .....
不知道我是不是理解了你的意思。
发表于 2010-3-5 15:43:36 | 显示全部楼层
你得贴出你的源码。。。我们看着好说改哪儿////

简单来说:
比如:
$Button6 = GUICtrlCreateButton("确定", 256, 275, 80, 25)
然后:在CASE的时候:就可以先msgbox一下或者再画个GUI让用户确认。
发表于 2010-3-5 16:13:59 | 显示全部楼层
 楼主| 发表于 2010-3-5 16:24:01 | 显示全部楼层
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Button2
                        Exit
                Case $Button1
$Button1 = MsgBox(257,"你好世界","你好世界!你好吗?")

                        ExitLoop
        EndSwitch
        If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
        $time -= 1
        GUICtrlSetData($Label1, $time & "秒后机器重启进入超级状态!")
        GUICtrlSetData($Progress1, (30 - $time) / 0.3)
        If $time <= 0 Then AdlibUnRegister()
EndFunc   ;==>_timer

Func main()
Run("D:\Program Files\Tencent\QQ\Bin\QQ.exe");启动qq

EndFunc   ;==>main
 楼主| 发表于 2010-3-5 16:25:48 | 显示全部楼层
$Button1 = MsgBox(257,"你好世界","你好世界!你好吗?")
这个默认是第二项取消了。
如果点下确定运行下面程序。  点取消继续倒计时。
 楼主| 发表于 2010-3-5 16:28:23 | 显示全部楼层
$Label1 = GUICtrlCreateLabel("30秒后机器重启进入超级状态!", 1, 50, 400, 28)
GUICtrlSetFont(-1, 12, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Button2
                        Exit
                Case $Button1
GUICreate("你好世界", 200, 100)
GUICtrlCreateLabel("你好世界!你好么?", 30, 10)
$okbutton1 = GUICtrlCreateButton("取消", 20, 50, 60)
$okbutton2 = GUICtrlCreateButton("确定", 120, 50, 60)
GUISetState(@SW_SHOW)

While 1
  $msg = GUIGetMsg()

  Select
    Case $msg = $okbutton1
exit(0)
    Case $msg = $okbutton2
$okbutton2 = $Button1
      ExitLoop
  EndSelect
WEnd
                        ExitLoop
exit
        EndSwitch
        If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
        $time -= 1
        GUICtrlSetData($Label1, $time & "秒后机器重启进入超级状态!")
        GUICtrlSetData($Progress1, (30 - $time) / 0.3)
        If $time <= 0 Then AdlibUnRegister()
EndFunc   ;==>_timer

Func main()
Run("D:\Program Files\Tencent\QQ\Bin\QQ.exe");启动qq

EndFunc   ;==>main


用这个只是点下取消。。 连倒计时都取消了。  能否点下倒时计不取消。 而提示框取消
 楼主| 发表于 2010-3-5 16:33:19 | 显示全部楼层
回复 5# boyhong



画个GUI让用户确认  点取消时候把倒时倒都关了。   能否不关?只关这个GUI
发表于 2010-3-5 16:40:09 | 显示全部楼层
标题模糊|违规,不利于论坛搜索,此主题已暂时关闭。请依照论坛发帖规则修改标题。并于修改合格之后,联系本版版主或管理员打开(务必附上被关闭的帖子链接)。若3日后仍未修改,将移入论坛回收站。若放弃对此主题的修改而重新开贴,将删除新帖并从重处罚。

附:论坛发帖规则 http://www.autoitx.com/forum.php?mod=viewthread&tid=10945
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-1 17:50 , Processed in 0.080753 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表