Например есть окно 600 на 200 как сделать так чтобы при нажатии кнопки окно раздвинулось и стало бы скажем 600 на 600
И например там была бы кнопка которая востановила бы прежнии размеры
Скажем для того чтобы там прятать справочную информацию
#include <GUIConstantsEx.au3>
$GUI = GUICreate("assch", 600,200)
GUISetIcon ("02.ico")
$Button1 = GUICtrlCreateButton("Справка", 450, 20, 120, 60)
$Button2 = GUICtrlCreateButton("Назад", 450, 220, 120, 60)
GUISetState()
While 1
$iMsg = GUIGetMsg()
Select
Case $iMsg = $Button1
Case $iMsg = $Button1
Case $iMsg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
Пример:
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <GUIConstantsEx.au3>
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <ButtonConstants.au3>
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <WindowsConstants.au3>
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <GUIImageList.au3>
Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $hImageList
Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $sOld_Opt_GRM = Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("GUIResizeMode", $GUI_DOCKALL)
Global (http://www.autoitscript.com/autoit3/docs/keywords.htm#Global) $iGUI_Height = 200
$hGUI = GUICreate (http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm)("Expand GUI Example", 300, $iGUI_Height, -1, -1, -1, $WS_EX_TOOLWINDOW)
$Expand_Button = GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm)("Expand", 20, 80, 80, 22, $BS_ICON)
_GUICtrlButton_SetImageEx($hImageList, $Expand_Button, @SystemDir (http://www.autoitscript.com/autoit3/docs/macros.htm#@systemdir) & "\rasdlg.dll", 14)
#Region Expanded controls
GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm)("Some Button", 20, 240, 80)
GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm)("Other Button", 120, 240, 80)
GUICtrlCreateInput (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateInput.htm)("Some Input", 20, 200, 200, 20)
Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("GUIResizeMode", $sOld_Opt_GRM)
#EndRegion Expanded controls
;
GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)()
While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
$Msg = GUIGetMsg (http://www.autoitscript.com/autoit3/docs/functions/GUIGetMsg.htm)()
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $Msg
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $GUI_EVENT_CLOSE
_GUIImageList_Destroy (http://dundats.mvps.org/help/html/libfunctions/_guiimagelist_destroy.htm)($hImageList)
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $Expand_Button
_Toggle_ExpandControls_Proc($hGUI, $iGUI_Height, $iGUI_Height + 80, $Expand_Button)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _Toggle_ExpandControls_Proc($hWnd, $iInitWndHeight, $iExpndHeight, $iExpndCtrlID, $sExpndText="Expand", $sCntrctText="Collapse")
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $iHeight, $sButtonText, $aSysCaptMetrics, $aSysBordMetrics
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $aWinSize = WinGetPos (http://www.autoitscript.com/autoit3/docs/functions/WinGetPos.htm)($hWnd)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $aWinClientSize = WinGetClientSize (http://www.autoitscript.com/autoit3/docs/functions/WinGetClientSize.htm)($hWnd)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $iBorderWidth = $aWinSize[2] - $aWinClientSize[0]
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $iCaptionHeight = $aWinSize[3] - $aWinClientSize[1] - $iBorderWidth
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $aWinSize[3] > $iExpndHeight + $iCaptionHeight Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then)
_GUICtrlButton_SetImageEx($hImageList, $Expand_Button, @SystemDir (http://www.autoitscript.com/autoit3/docs/macros.htm#@systemdir) & "\rasdlg.dll", 14)
$iHeight = $iInitWndHeight + $iCaptionHeight + $iBorderWidth
$sButtonText = $sExpndText
Else (http://www.autoitscript.com/autoit3/docs/keywords.htm#Else)
_GUICtrlButton_SetImageEx($hImageList, $Expand_Button, @SystemDir (http://www.autoitscript.com/autoit3/docs/macros.htm#@systemdir) & "\rasdlg.dll", 16)
$iHeight = $iExpndHeight + $iCaptionHeight + $iBorderWidth
$sButtonText = $sCntrctText
EndIf (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndIf)
GUICtrlSetData (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetData.htm)($iExpndCtrlID, $sButtonText)
WinMove (http://www.autoitscript.com/autoit3/docs/functions/WinMove.htm)($hWnd, "", $aWinSize[0], $aWinSize[1], $aWinSize[2], $iHeight)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc)
Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _GUICtrlButton_SetImageEx(ByRef (http://www.autoitscript.com/autoit3/docs/keywords.htm#ByRef) $hImageList, $nCtrl, $sIconFile, $nIconID=0, $nAlign=-1)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $hImageList Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) _GUIImageList_Destroy (http://dundats.mvps.org/help/html/libfunctions/_guiimagelist_destroy.htm)($hImageList)
$hImageList = _GUIImageList_Create (http://dundats.mvps.org/help/html/libfunctions/_guiimagelist_create.htm)(16, 16, 5, 1)
_GUIImageList_AddIcon (http://dundats.mvps.org/help/html/libfunctions/_guiimagelist_addicon.htm)($hImageList, $sIconFile, $nIconID)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $stBIL = DllStructCreate (http://www.autoitscript.com/autoit3/docs/functions/DllStructCreate.htm)("dword;int[4];uint")
DllStructSetData (http://www.autoitscript.com/autoit3/docs/functions/DllStructSetData.htm)($stBIL, 1, $hImageList)
DllStructSetData (http://www.autoitscript.com/autoit3/docs/functions/DllStructSetData.htm)($stBIL, 2, 1, 1)
DllStructSetData (http://www.autoitscript.com/autoit3/docs/functions/DllStructSetData.htm)($stBIL, 2, 1, 2)
DllStructSetData (http://www.autoitscript.com/autoit3/docs/functions/DllStructSetData.htm)($stBIL, 2, 1, 3)
DllStructSetData (http://www.autoitscript.com/autoit3/docs/functions/DllStructSetData.htm)($stBIL, 2, 1, 4)
DllStructSetData (http://www.autoitscript.com/autoit3/docs/functions/DllStructSetData.htm)($stBIL, 3, $nAlign)
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) GUICtrlSendMsg (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSendMsg.htm)($nCtrl, $BCM_SETIMAGELIST, 0, DllStructGetPtr (http://www.autoitscript.com/autoit3/docs/functions/DllStructGetPtr.htm)($stBIL))
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc)
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.