#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
|