回复 1# 19377708 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $Form2, $Button2
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE,"Form1_event")
$Button1 = GUICtrlCreateButton("打开窗体", 258, 218, 75, 25)
GUICtrlSetOnEvent(-1, "Form1_event")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(10)
WEnd
Func form2()
$Form2 = GUICreate("Form2", 482, 300, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_DLGFRAME, $WS_CLIPSIBLINGS), BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Form1)
$img = GUICtrlCreatePic("W_title_r1_c1.gif", 0, 0, 1, 1)
;上面那个图片不加上就不行,不知道为什么......你自己随便找个图片就行,图片我就不上传了
$Button2 = GUICtrlCreateButton("关闭此窗体", 190, 122, 103, 25)
GUICtrlSetOnEvent(-1, "Form2_event")
GUISetState(@SW_SHOW)
EndFunc ;==>form2
Func Form1_event()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
form2()
EndSwitch
EndFunc ;==>Form1_event
Func Form2_event()
Switch @GUI_CtrlId
Case $Button2
GUIDelete($Form2)
EndSwitch
EndFunc ;==>Form2_event
|