如何让窗口中的控件不随着窗口的缩放而改变位置【已解决】
本帖最后由 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
前面加上Opt('GUIResizeMode', 802) 楼上正解。。 本帖最后由 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 楼上正解! 楼上正解! 回复 4# gzh888666
不是可能,我就是要这种效果。太感谢了 呵呵,学习中,不错! 学习了.谢谢分享
页:
[1]