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

[GUI管理] (已解决)GUI在原有窗口上扩大要怎么写

  [复制链接]
发表于 2010-7-10 01:27:08 | 显示全部楼层 |阅读模式
本帖最后由 minghui 于 2010-7-12 23:38 编辑

图1


图2


像上面图1中那样点高级后扩大成图2那样,AU3要怎么写

本帖子中包含更多资源

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

×
发表于 2010-7-10 01:31:45 | 显示全部楼层
WinGetPos()
WinMove()
 楼主| 发表于 2010-7-10 01:52:58 | 显示全部楼层
本帖最后由 minghui 于 2010-7-10 01:54 编辑

可能我比较愚钝,还是没有搞明白, 使用 WinMove() 函数后原先调好的按钮等也会被一起拉宽,而不会像图中那样保持不变
发表于 2010-7-10 01:54:15 | 显示全部楼层
那你再看一个函数 GUICtrlSetResizing()
 楼主| 发表于 2010-7-10 02:15:01 | 显示全部楼层
谢谢 afan 版主 基本上算是可以了, 细节方面还是不太懂,版主要是能给个例子就好了,不知道是不是有点贪了
发表于 2010-7-10 02:37:27 | 显示全部楼层
$Form1 = GUICreate('伸缩窗口', 350, 150)
$Button1 = GUICtrlCreateButton('展开', 15, 78, 80, 22)
GUICtrlSetResizing(-1, 0x0322) ;$GUI_DOCKALL = 0x0322
$Label1 = GUICtrlCreateLabel('www.autoitx.com - afan', 150, 130, 345, 17)
GUICtrlSetResizing(-1, 0x0240) ;$GUI_DOCKSTATEBAR = 0x0240
GUISetState()

While 1
        $Msg = GUIGetMsg()
        Switch $Msg
                Case -3
                        Exit
                Case $Button1
                        $BtTxt = GUICtrlRead($Button1)
                        Move($BtTxt)
        EndSwitch
WEnd

Func Move($BtTxt)
        $guixy = WinGetPos($Form1)
        If $BtTxt = '收缩' Then
                GUICtrlSetData($Button1, '展开')
                $new_guiY = $guixy[3] - 240
        Else
                GUICtrlSetData($Button1, '收缩')
                $new_guiY = $guixy[3] + 240
        EndIf
        WinMove($Form1, '', $guixy[0], $guixy[1], $guixy[2], $new_guiY)
EndFunc   ;==>Move
 楼主| 发表于 2010-7-10 02:46:01 | 显示全部楼层
回复 6# afan
谢谢,谢谢! 总算是解决了.
发表于 2010-8-13 20:18:47 | 显示全部楼层
好招,学习了。
发表于 2010-8-15 07:33:25 | 显示全部楼层
回复 6# afan

看着你写的代码很舒服
发表于 2011-9-28 23:39:26 | 显示全部楼层
前来膜拜一下,果然神人啊,太强大了。。。
发表于 2011-12-9 10:55:03 | 显示全部楼层
明白。。。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-3 00:39 , Processed in 0.075496 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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