Помогите нужно при нажатие на $Button2 закрывать $Form2
Код:
global $Button2
#Region ### START Koda GUI section ### Form=
;создали основное окно и кнопку
$Form2 = GUICreate("Form2", 413, 300, 302, 218)
$Button1 = GUICtrlCreateButton("Button1", 136, 104, 145, 73, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Func win()
;написали функцию создающую форму и кнопку которая должна его закрыть "Forma2"
$Form2 = GUICreate("Form2", 413, 300, 302, 218)
$Button2 = GUICtrlCreateButton("Button2", 136, 104, 145, 73, $WS_GROUP)
GUISetState(@SW_SHOW)
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
win()
Case $Button2
;какой оператор применить ума не прилажу прибывал winclose но он закрывает все формы
EndSwitch
WEnd