Hallo Zusammen,
irgendwie bin ich zu blöd. Ich bin derzeit am schreiben eines Scripts das meine GUI ausliest und dann die Daten die dort eingegeben worden sind per Mail zu verschicken. Jetzt probiere ich gerade ein Feld ($nm_firstname = GUICtrlCreateInput("", 144, 72, 121, 21)) "Vorname" als Pflichtfeld zu hinterlegen.
Das sieht bei mir dann so aus:
Spoiler anzeigen
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
;##################################
;GUI auslesen
;##################################
$nm_firstname = GUICtrlRead($nm_firstname)
If $nm_firstname = "" Then
MsgBox(16, "Sie haben ein Pflichtfeld vergessen", "Der Vorname des Mitarbeiters ist ein Pflichtfeld")
_main ()
Exit
EndIf
$nm_lastname = GUICtrlRead($nm_lastname)
$nm_username = GUICtrlRead($nm_username)
$nm_entry = GUICtrlRead($nm_entry)
$akt_firstname = GUICtrlRead($akt_firstname)
$akt_lastname = GUICtrlRead($akt_lastname)
$akt_username = GUICtrlRead($akt_username)
$domain_acc = GUICtrlRead($domain_acc)
$LN_acc = GUICtrlRead($LN_acc)
$psnext_acc = GUICtrlRead($psnext_acc)
$vpn_acc = GUICtrlRead($vpn_acc)
$telefon = GUICtrlRead($telefon)
; $ln_grouplist = GUICtrlRead($ln_grouplist)
$adminlist = GUICtrlRead($adminlist)
;$admin_pw = GUICtrlRead($admin_pw)
$FromName = $adminlist ; name from who the email was sent
;Umwandeln des Namens in Mailadresse
Local $fname = StringSplit($adminlist, " ")
$Mailname = $fname[1] & "." & $fname[2]
$Mailname = StringLower($Mailname)
$Mailname = $Mailname & "@gmail.com"
Global $FromAddress = $Mailname ; address from where the mail should come
Global $Username = $adminlist ; username for the account used from where the mail gets sent - REQUIRED
Global $Password = "" ; password for the account used from where the mail gets sent - REQUIRED
Global $BccAddress = $Mailname ; address for bcc - leave blank if not needed
Local $sItems, $aItems, $hListBox
$aItems = _GUICtrlListBox_GetSelItemsText($ln_grouplist)
For $iI = 1 To $aItems[0]
If $iI > 1 Then $sItems &= ", "
$sItems &= $aItems[$iI]
$ln_grouplist = $sItems
Next
_check ()
MsgBox(0, "neue Accounts bestellt", "Alle Emails wurden erfolgreich gesendet. Bitte eigenen Posteingang prüfen.")
Exit
Case $Exit
Exit
EndSwitch
WEnd
In dieser Variante springt er zum Anfang zurück. Aber, er öffnet ein weiteres Fenster. Ich habe bereits auch andere Varianten probiert, allerdings habe ich das Gefühl das die GUI immer nur einmal ausgelesen wird.
Fülle ich die GUI ganz normal aus und drücke start läuft das Script durch. Fülle ich die GUI erneut anders aus sind alle Eingabefelder = "0".
Freue mich über sinnvolle Antworten.