找回密码
 加入
搜索
查看: 3780|回复: 8

[AU3基础] 如何让窗口中的控件不随着窗口的缩放而改变位置【已解决】

  [复制链接]
发表于 2011-11-2 01:19:18 | 显示全部楼层 |阅读模式
本帖最后由 xwt620 于 2011-11-2 20:04 编辑


如图,如果点击最大化,那么button和listview就分散了,而我期望的是button和listview还是很紧凑,只是listview随着窗口放大。
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 408, 270, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP))
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 88, 8, 75, 25)
$ListView1 = GUICtrlCreateListView("", 8, 40, 393, 225)
$Button3 = GUICtrlCreateButton("Button3", 168, 8, 75, 25)
$Button4 = GUICtrlCreateButton("Button4", 248, 8, 75, 25)
$Button5 = GUICtrlCreateButton("Button5", 328, 8, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

本帖子中包含更多资源

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

×
发表于 2011-11-2 01:45:20 | 显示全部楼层
前面加上
Opt('GUIResizeMode', 802)

评分

参与人数 1金钱 +10 贡献 +1 收起 理由
.個朲綉√ + 10 + 1 太佩服你了.

查看全部评分

发表于 2011-11-2 09:45:00 | 显示全部楼层
楼上正解。。
发表于 2011-11-2 13:52:41 | 显示全部楼层
本帖最后由 gzh888666 于 2011-11-2 14:00 编辑

他可能要的是这种效果
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIResizeMode",802)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 408, 270, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP))
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 88, 8, 75, 25)
$ListView1 = GUICtrlCreateListView("", 8, 40, 393, 225)
GUICtrlSetResizing (-1,102 )
$Button3 = GUICtrlCreateButton("Button3", 168, 8, 75, 25)
$Button4 = GUICtrlCreateButton("Button4", 248, 8, 75, 25)
$Button5 = GUICtrlCreateButton("Button5", 328, 8, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
发表于 2011-11-2 15:38:31 | 显示全部楼层
楼上正解!
发表于 2011-11-2 19:29:49 | 显示全部楼层
楼上正解!
 楼主| 发表于 2011-11-2 20:01:56 | 显示全部楼层
回复 4# gzh888666


    不是可能,我就是要这种效果。太感谢了
发表于 2011-11-3 09:48:37 | 显示全部楼层
呵呵,学习中,不错!
发表于 2011-11-7 03:33:21 | 显示全部楼层
学习了.谢谢分享
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-1 09:44 , Processed in 0.085059 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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