Servous,
ich habe ein Problem und zwar wenn ich auf den Knopf (bei mindestens ein leeres Input) drücke Stürzt/hängt sich auf mein Programm auf.
Ich habe schon verschiedene Try/Catchs Methoden Versucht aber keines half -- Ist hier überhaupt Try/Catch sinnvoll oder reichen normale IF-Abfragen?
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;------------------------------------------------------------------------------------------------------------------
$Form1 = GUICreate("Form1", 149, 119, 235, 157)
$Button1 = GUICtrlCreateButton("Button1", 32, 80, 75, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("", 16, 16, 121, 21)
$Input2 = GUICtrlCreateInput("", 16, 48, 121, 21)
GUISetState(@SW_SHOW)
;------------------------------------------------------------------------------------------------------------------
$Form2 = GUICreate("Form1", 413, 305, 348, 133)
$Edit1 = GUICtrlCreateEdit("", 16, 8, 377, 273)
GUISetState(@SW_HIDE)
;------------------------------------------------------------------------------------------------------------------
Func Uebernahme()
While Not @error ;Try
If Guictrlread($Input1) <> "" Then
$sBla = "text" & Guictrlread($Input1) &"text"
EndIf
WEnd
Guictrlsetdata($Edit1, $sBla)
EndFunc
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[1] ; window-handle
Case $Form1 ;hier kommt alles zur 1ten gui rein
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Uebernahme()
GUISetState(@SW_HIDE, $Form1);frmMain->visible = false
GUISetState(@SW_SHOW, $Form2);frmInfo->visible = true
EndSwitch
Case $Form2 ; hier kommt alles zur 2ten gui rein
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GuiCtrlSetData($Edit1, "")
GUISetState(@SW_SHOW, $Form1) ;frmMain->visible = true
GUISetState(@SW_HIDE, $Form2) ;frmInfo->visible = false
EndSwitch
EndSwitch
WEnd
Danke im Vorraus.
Grüße myrix