Moin,
Ich habe schon wieder eine Frage ![]()
Und zwar wenn ich über eine GUI/MsgBox eine 2. GUI/MsgBox öffne und dann die vordere schließe, schließt sich auch die 1.
Wie mach ich das die 1. offen bleibt?
mfg
Moin,
Ich habe schon wieder eine Frage ![]()
Und zwar wenn ich über eine GUI/MsgBox eine 2. GUI/MsgBox öffne und dann die vordere schließe, schließt sich auch die 1.
Wie mach ich das die 1. offen bleibt?
mfg
Hi,
gib mal deinen Code. Hellsehen können wir nicht ![]()
Stimmt ![]()
Ich hab mal eine Beispiel gemacht...
Also
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 558, 320, 192, 124)
$Button1 = GUICtrlCreateButton("2. Gui öffnen", 320, 264, 201, 41, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Blablabla", 24, 8, 484, 193)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 409, 298, 216, 155)
$Button1 = GUICtrlCreateButton("ggf zurück zur 1.gui", 256, 224, 129, 49, $WS_GROUP)
$Button2 = GUICtrlCreateButton("bla", 40, 232, 113, 41, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndSwitch
WEnd
Also ich meine wenn man jetzt die 2. Gui öffnet und die dann durchs x wegmacht dann gehen ja beide weg ![]()
Wie änder ich das sodass nur die 2. Gui sich schließt...
Hi,
das liegt daran das du in der inner While Schleife Exit statt Exitloop steht.
Case $Button1
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 409, 298, 216, 155)
$Button1 = GUICtrlCreateButton("ggf zurück zur 1.gui", 256, 224, 129, 49, $WS_GROUP)
$Button2 = GUICtrlCreateButton("bla", 40, 232, 113, 41, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Bei mir schließt die sich jezt erst gar nicht und bei 2.mal dann wieder alles ![]()
Hi,
meinst du sowas ?
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Global $ShowedGUIs = 2
$hGUI1 = GUICreate("GUI1", 500, 500, 50, 50)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_GUI1")
GUISetState(@SW_SHOW)
$hGUI2 = GUICreate("GUI2", 500, 500, 100, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_GUI2")
GUISetState(@SW_SHOW)
While $ShowedGUIs
Sleep(50)
WEnd
Func _Exit_GUI1()
GUIDelete($hGUI1)
$ShowedGUIs -= 1
EndFunc ;==>_Exit_GUI1
Func _Exit_GUI2()
GUIDelete($hGUI2)
$ShowedGUIs -= 1
EndFunc ;==>_Exit_GUI2
oder vielleicht so:
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Array.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 558, 320, 192, 124)
$Form1Button1 = GUICtrlCreateButton("2. Gui öffnen", 320, 264, 201, 41, $WS_GROUP)
$Form1Label1 = GUICtrlCreateLabel("Blablabla", 24, 8, 484, 193)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
#region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 409, 298, 216, 155)
$Form2Button1 = GUICtrlCreateButton("ggf zurück zur 1.gui", 256, 224, 129, 49, $WS_GROUP)
$Form2Button2 = GUICtrlCreateButton("bla", 40, 232, 113, 41, $WS_GROUP)
GUISetState(@SW_HIDE)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE, $nMsg[1])
Case $Form1Button1
GUISetState(@SW_SHOW, $Form2)
Case $Form2Button1
GUISetState(@SW_HIDE, $Form2)
EndSwitch
WEnd
So ist es perfekt, Danke!!