[HILFE] $GUI_EVENT_CLOSE

03/25/2011 22:14 xEr0r#1
Also sagen wir ich hab eine GUI. Jz drück ich auf nen Button und er öffnet sich ne neue Form mit ner Input und nem Button. Jz will ich das, wenn ich bei der 2. Form auf den X Button also zum schließen drücke, nur Form 2 geschlossen wird und nicht beide. Geht das?

GIbtn Thx^^ :rtfm:
03/25/2011 23:51 omer36#2
zb so
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form= ;erste gui erstellt..
$Form1 = GUICreate("Form1", 625, 443, 192, 124)
$Button1 = GUICtrlCreateButton("2. gui öffnen", 8, 150, 80, 33, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
#Region ### START Koda GUI section ### Form= ;zweite gui erstellt...
$Form2 = GUICreate("andere gui", 574, 191, 210, 205)
$Button2 = GUICtrlCreateButton("schließen", 8, 72, 57, 33, $WS_GROUP)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg(1)
    Switch 
$nMsg[1]
        Case 
$Form1
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button1
                    GUISetState
(@SW_SHOW, $Form2)
            EndSwitch
        Case 
$Form2
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    GUISetState
(@SW_HIDE, $Form2)
                Case 
$Button2
                    GUISetState
(@SW_HIDE, $Form2)
            EndSwitch
    EndSwitch
WEnd