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