Von Form Zu Form Wechseln.

04/14/2011 13:52 Toasty-man#1
Hallo Erstmal!
Ich wollte mal etwas machen das von einer form zur anderen wechselt jetzt wollt ich das aber auch so machen das wenn man auf einen zurück button klickt es wieder zur ersten form kommt und dann alles neu einstellen kann. also bis zu dem zurück und neu einstellen hab ich geschafft aber wenn man dann wieder auf weiter klickt passiert nix ... Könntet ihr mir helfen? Hier ist ein beispiel script

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 GUICreate("(Nachgestellt)"22774191122)
$Button1 GUICtrlCreateButton("Zurück"8810757$WS_GROUP)
GUICtrlSetState(-1$GUI_DISABLE)
$Button2 GUICtrlCreateButton("Weiter"112810757$WS_GROUP)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button2
            Gui2
()

    EndSwitch
WEnd


Func Gui2
()
    
GUISetState(@SW_HIDE$Form1)
    
#region ### START Koda GUI section ### Form=
    
$Form2 GUICreate("(Nachgestellt)"33182192124)
    
$Button1 GUICtrlCreateButton("Zurück"8810765$WS_GROUP)
    
$Button2 GUICtrlCreateButton("Msg Box"112810765$WS_GROUP)
    
$Button3 GUICtrlCreateButton("Weiter"216810765$WS_GROUP)
    
GUICtrlSetState(-1$GUI_DISABLE)
    
GUISetState(@SW_SHOW)
    
#endregion ### END Koda GUI section ###

    
While 1
        $nMsg 
GUIGetMsg()
        Switch 
$nMsg
            
Case $GUI_EVENT_CLOSE
                
Exit
            Case 
$Button1
                GUISetState
(@SW_SHOW$Form1)
                
GUISetState(@SW_HIDE$Form2)
            Case 
$Button2
                MsgBox
(0"Test""Test")

        EndSwitch
    
WEnd
EndFunc 
04/14/2011 14:56 omer36#2
zb so:

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("(Nachgestellt)"22774191122)
$Button1 GUICtrlCreateButton("Zurück"8810757$WS_GROUP)
GUICtrlSetState(-1$GUI_DISABLE)
$Button2 GUICtrlCreateButton("Weiter"112810757$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Form2 GUICreate("(Nachgestellt)"33182192124)
$Button3 GUICtrlCreateButton("Zurück"8810765$WS_GROUP)
$Button4 GUICtrlCreateButton("Msg Box"112810765$WS_GROUP)
$Button5 GUICtrlCreateButton("Weiter"216810765$WS_GROUP)
GUICtrlSetState(-1$GUI_DISABLE)
GUISetState(@SW_HIDE$Form2)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg 
GUIGetMsg(1)
    Switch 
$nMsg[1]
        Case 
$Form1
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button2
                    GUISetState
(@SW_HIDE$Form1)
                    
GUISetState(@SW_SHOW$Form2)
            EndSwitch
        Case 
$Form2
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button3
                    GUISetState
(@SW_SHOW$Form1)
                    
GUISetState(@SW_HIDE$Form2)
                Case 
$Button4
                    MsgBox
(0"Test""Test")
            EndSwitch
    EndSwitch
WEnd 
04/14/2011 15:04 Toasty-man#3
Quote:
Originally Posted by omer36 View Post
zb so:

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("(Nachgestellt)"22774191122)
$Button1 GUICtrlCreateButton("Zurück"8810757$WS_GROUP)
GUICtrlSetState(-1$GUI_DISABLE)
$Button2 GUICtrlCreateButton("Weiter"112810757$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Form2 GUICreate("(Nachgestellt)"33182192124)
$Button3 GUICtrlCreateButton("Zurück"8810765$WS_GROUP)
$Button4 GUICtrlCreateButton("Msg Box"112810765$WS_GROUP)
$Button5 GUICtrlCreateButton("Weiter"216810765$WS_GROUP)
GUICtrlSetState(-1$GUI_DISABLE)
GUISetState(@SW_HIDE$Form2)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg 
GUIGetMsg(1)
    Switch 
$nMsg[1]
        Case 
$Form1
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button2
                    GUISetState
(@SW_HIDE$Form1)
                    
GUISetState(@SW_SHOW$Form2)
            EndSwitch
        Case 
$Form2
            
Switch $nMsg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button3
                    GUISetState
(@SW_SHOW$Form1)
                    
GUISetState(@SW_HIDE$Form2)
                Case 
$Button4
                    MsgBox
(0"Test""Test")
            EndSwitch
    EndSwitch
WEnd 
Danke! Klappt Perfekt! :D Ich Danke Dir...

Edit: Hm Leider klappt nur das beispiel wenn ich das dan in mein eigentliches script einbaue zeigt es nicht die 2te form an und wenn ich auf andere buttons klicke passiert auch nichts... ich kann dann nur x drücken oder minimieren.