找回密码
 加入
搜索
查看: 2969|回复: 12

msg对话框如何做到在主窗口内居中?

  [复制链接]
发表于 2008-10-7 21:32:05 | 显示全部楼层 |阅读模式
是指在程序主窗口内居中,而不是屏幕居中,这要怎么解决呢?

[ 本帖最后由 bikaku 于 2008-10-7 21:33 编辑 ]
发表于 2008-10-8 15:24:18 | 显示全部楼层
解决了吗?
说说方法?
 楼主| 发表于 2008-10-10 21:30:31 | 显示全部楼层
没有解决啊,希望大虾能指点下。
 楼主| 发表于 2008-10-10 21:32:39 | 显示全部楼层
希望能有大虾指点下。
 楼主| 发表于 2008-10-10 21:34:25 | 显示全部楼层
为什么我的帖子要审核呢?三恨能否给个说法。
 楼主| 发表于 2008-10-12 16:53:59 | 显示全部楼层
限制该回帖? 三恨是否能给个说法啊!
发表于 2008-10-12 17:00:57 | 显示全部楼层
这是个很好的问题,可惜俺也不会,呜呜! 大虾们请支招啊~~
发表于 2008-10-12 19:43:55 | 显示全部楼层
建议自已写一个函数
发表于 2008-10-13 10:02:14 | 显示全部楼层
原帖由 pcbar 于 2008-10-12 19:43 发表
建议自已写一个函数

lz能否给出具体代码?拜托!
发表于 2008-10-13 17:48:10 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 439, 297, 281, 213)
$Button1 = GUICtrlCreateButton("点我试试", 176, 128, 75, 25, 0)

GUISetState(@SW_SHOW,$Form1)

#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1
$xy=WinGetPos($Form1,"")
$Form2 = GUICreate("Form2", 225, 109,$xy[0]+ ($xy[2]-225)/2 , $xy[1]+ ($xy[3]-109)/2)
$Button2 = GUICtrlCreateButton("关闭", 64, 40, 75, 25, 0)
GUISetState(@SW_SHOW,$Form2)
While 1
$nMsg2 = GUIGetMsg()
Switch $nMsg2
                Case $Button2
           GUIDelete($Form2)
       ExitLoop
        EndSwitch
WEnd

        EndSwitch
WEnd
发表于 2008-10-15 22:45:59 | 显示全部楼层
原帖由 gto250 于 2008-10-13 17:48 发表
#include
#include
#include GUI ...

感谢lz回答,等下试试你的方法。
发表于 2008-10-16 00:55:52 | 显示全部楼层
支持~~~~~~~~~~~
发表于 2008-10-19 10:21:05 | 显示全部楼层
原帖由 gto250 于 2008-10-13 17:48 发表
#include
#include
#include

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 439, 297, 281, 213)
$Button1 = GUICtrlCreateButton("点我试试", 176, 128, 75, 25, 0)

GUI ...

本帖楼主的问题,好像说的是msg对话框,不是窗口居中哦。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-23 11:27 , Processed in 0.081312 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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