Moin,
wie im Beispiel unten soll die Form2 mit der Form1 über den Button $Button1 gestartet werden.
Die Form1 verliert damit den Loop!
Wenn ich von der Form2 ohne Schließen der Form1 den $Button2 auf der Form1 wieder betätigen möchte, ist es ja nicht mehr möglich, da Form2 den Loop hat.
Wie kann ich es lösen, habt ihr eine Idee?
Gruß Wuff
AutoIt
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, -1, -1)
$Button1 = GUICtrlCreateButton("Button1", 200, 56, 145, 41)
$Button2 = GUICtrlCreateButton("Hallo", 208, 184, 137, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If GUIDelete($Form1) Then ExitLoop
Case $Button1
_Form2()
Case $Button2
MsgBox(1, "", "Hallo Form1")
EndSwitch
WEnd
Func _Form2()
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 615, 437, 500, -1)
$Button2 = GUICtrlCreateButton("Button1", 200, 56, 145, 41)
$Button3 = GUICtrlCreateButton("Hallo", 208, 184, 137, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If GUIDelete($Form2) Then ExitLoop
Case $Button2
_Form2()
Case $Button3
MsgBox(1, "", "Hallo Form2")
EndSwitch
WEnd
EndFunc ;==>_Form2
Alles anzeigen