本帖最后由 水木子 于 2010-11-23 23:00 编辑
各位前辈好!
下面是我做的窗体,我想通过“设置”调整窗体大小,并在调整后的窗体上创建新的控件。
窗体大小是调整了,但是窗体内部的控件也跟着变动了,这是怎么回事啊?
搜索了几遍未果,望各位指教啊!#include <WindowsConstants.au3>
$Form1 = GUICreate('表单', 250, 350, -1, -1)
$ListView1 = GUICtrlCreateListView('项目1 |项目2 ', 15, 15, 220, 240)
$Button1 = GUICtrlCreateButton('设置→', 30, 280, 75, 30, $WS_GROUP)
$Button2 = GUICtrlCreateButton('退出', 150, 280, 75, 30, $WS_GROUP)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3, $Button2
Exit
Case $Button1
If GUICtrlRead($Button1) = '设置→' Then
WinMove($Form1, '', Default, Default, 500, Default)
GUICtrlSetData($Button1, '设置←')
ElseIf GUICtrlRead($Button1) = '设置←' Then
WinMove($Form1, '', Default, Default, 256, Default)
GUICtrlSetData($Button1, '设置→')
EndIf
EndSwitch
WEnd
|