hallo, probiere mich grad mal nen bisl am onevent mode. mein problem hierbei ist das ich eine 2.form via button öffne, diese wiederum mit hilfe eines anderen buttons schliesse.
jetzt besteht das problem das der erste button, also mit dem ich die 2. form geöffnet habe nicht mehr reagiert.
vielleicht kann mir da wer auf die sprünge helfen.
[autoit]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
global $form2
$Form1 = GUICreate("Form1", 192, 138, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("öffne form2", 54, 52, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Form2")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func Form2()
$Form2 = GUICreate("Form2", 192, 138, 192, 124, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
GUICtrlSetOnEvent(-1, "schliessen")
$Button2 = GUICtrlCreateButton("schliessen", 54, 52, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "schliessen")
GUISetState(@SW_SHOW)
EndFunc ;==>Form2
Func Form1Close()
Exit
EndFunc
func schliessen()
GUISetState(@SW_HIDE,$Form2)
EndFunc