Code
Procedure Animate_Winodw(State)
If State=1 ; Развернуть окно
For i=110 To 264 Step 2
ResizeWindow(0,#PB_Ignore,#PB_Ignore,#PB_Ignore ,i )
;SetGadgetState(2,State)
For x=1 To 10
WindowEvent()
Next x
Delay(8)
Next i
Else ; Свернуть окно
For i=264 To 110 Step -2
ResizeWindow(0,#PB_Ignore,#PB_Ignore,#PB_Ignore ,i )
;SetGadgetState(2,State)
For x=1 To 10
WindowEvent()
Next x
Delay(8)
Next i
EndIf
EndProcedure
OpenWindow(0, 314, 315, 300, 110,"Окно", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CheckBoxGadget(2, 10, 90, 230, 15, "Включить анимацию")
Repeat
Event=WaitWindowEvent()
If Event=#PB_Event_Gadget
If EventGadget()=2
x=GetGadgetState(2)
Animate_Winodw(x)
EndIf
EndIf
Until Event=#PB_Event_CloseWindow