找回密码
 加入
搜索
查看: 1472|回复: 4

什么函数能调整GUI界面的尺寸?

[复制链接]
发表于 2008-12-6 19:28:30 | 显示全部楼层 |阅读模式
GUICreate建立了个GUI。
有没有什么函数能改变原先建立的窗口尺寸。但界面里面按钮的按钮文本框等位置最好不产生变化

[ 本帖最后由 黑菜 于 2008-12-6 21:44 编辑 ]
发表于 2008-12-6 20:07:58 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>

Opt('GUIResizeMode', 802) ;<==注意这一句

$Window = GUICreate("窗口大小改变示例", 367, 300, 192, 114)
$Button1 = GUICtrlCreateButton("Button", 262, 32, 83, 25, 0)
$Button2 = GUICtrlCreateButton("Button", 262, 68, 83, 25, 0)
$Button3 = GUICtrlCreateButton("Button", 262, 104, 83, 25, 0)
$Button4 = GUICtrlCreateButton("设置↓", 262, 140, 83, 25, 0)
$Button5 = GUICtrlCreateButton("Button", 262, 193, 83, 25, 0)
$Button6 = GUICtrlCreateButton("Button", 262, 226, 83, 25, 0)
$Button7 = GUICtrlCreateButton("Button", 262, 260, 83, 25, 0)
GUISetState(@SW_SHOW)


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button4
                        $pos = WinGetPos("窗口大小改变示例","")
                        If GUICtrlRead($Button4) = "设置↓" Then
                                WinMove  ($Window,"", Default, Default, Default , 620);620;605
                                GUICtrlSetData($Button4,"设置↑")
                        ElseIf GUICtrlRead($Button4) = "设置↑" Then
                                WinMove  ($Window,"", Default, Default,Default , 350);350;326
                                GUICtrlSetData($Button4,"设置↓")
                        EndIf
        EndSwitch
WEnd

评分

参与人数 1金钱 +5 收起 理由
黑菜 + 5 谢谢

查看全部评分

 楼主| 发表于 2008-12-6 21:39:07 | 显示全部楼层
原帖由 webhelp 于 2008-12-6 20:07 发表
[au3]#include
#include
#include

Opt('GUIResizeMode', 802) ;

谢谢,完全合我意
发表于 2012-12-4 10:40:42 | 显示全部楼层
有方法能做成像IE那样点击后自动最大化最小化的方法么?
谢谢
发表于 2012-12-4 12:26:32 | 显示全部楼层
除了窗口,其他例如ListView也能这样吗?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-29 17:27 , Processed in 0.190010 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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