找回密码
 加入
搜索
查看: 2320|回复: 3

[AU3基础] 如何让MsgBox在主窗体中间显示

[复制链接]
发表于 2015-3-15 13:57:56 | 显示全部楼层 |阅读模式
本帖最后由 dnvplj 于 2015-3-15 16:39 编辑

请问各位朋友:如何让“MsgBox”跟随主窗体并在其“中间”显示。
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 317, 160, @DesktopWidth-336, @DesktopHeight-540)
$Group1 = GUICtrlCreateGroup("", 8, 8, 305, 105)
$Label1 = GUICtrlCreateLabel("显示主窗体", 104, 48, 109, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("确    定", 176, 120, 65, 33)
$Button2 = GUICtrlCreateButton("取   消", 248, 120, 65, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                        
                Case $Button1
                        RunWait('C:\Soft01\Setup.exe')
                        MsgBox(0,'MsgBox显示','随主窗体 - 在主窗体中间显示')
                                                
                Case $Button2
                        Exit
                        
        EndSwitch
WEnd
发表于 2015-3-15 19:57:17 | 显示全部楼层
把这个MSGBOX用子程序窗口来代替,就好解决了吧?
发表于 2015-3-15 20:16:34 | 显示全部楼层
本帖最后由 131738 于 2015-3-15 20:18 编辑

按 2 楼提议来吧, MsgBox 是 au3 调用系统的消息框...........
 楼主| 发表于 2015-3-15 20:39:46 | 显示全部楼层
回复 2# 半芯竹
朋友您好,能给个例子吗?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-10 07:14 , Processed in 0.073788 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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