Hallo Leute,
wie kann ich bei einer GUI am besten eine vollständigeitsabfrage der 4 Inputfelder (die nicht leer sein dürfen) und der 2 Radiobuttons ( entweder oder schaltung) durchführen.
danke für eure Hilfe
TOMTOM
Hallo Leute,
wie kann ich bei einer GUI am besten eine vollständigeitsabfrage der 4 Inputfelder (die nicht leer sein dürfen) und der 2 Radiobuttons ( entweder oder schaltung) durchführen.
danke für eure Hilfe
TOMTOM
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $aInput[4]
$Form1 = GUICreate("Form1", 336, 167, 192, 139)
$aInput[0] = GUICtrlCreateInput("", 16, 8, 121, 21)
$aInput[1] = GUICtrlCreateInput("", 16, 40, 121, 21)
$aInput[2] = GUICtrlCreateInput("", 16, 72, 121, 21)
$aInput[3] = GUICtrlCreateInput("", 16, 104, 121, 21)
$iButton = GUICtrlCreateButton("prüfen", 176, 104, 105, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $iButton
_checkInputs()
EndSwitch
WEnd
func _checkInputs()
for $i = 0 to UBound($aInput)-1
if GUICtrlRead($aInput[$i]) = "" then
MsgBox(0,0, "Bitte alle Felder ausfüllen")
ExitLoop
EndIf
next
Return
EndFunc
Hai !
danke nochmals ... das hat mich dem ganzen schon etwas näher gebracht ....
was ich noch machen muss ist die abfrage auf die radiobuttons ....
ich schick mal die gui ::
#region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Einrichten eines 'SEND AS' Kontaktes", 432, 226, 345, 243)
$Label1 = GUICtrlCreateLabel("Name der Organisations Einheit", 15, 20, 152, 17)
Global $aOULIST = _COMBOSET()
$NameOE = GUICtrlCreateCombo("", 15, 40, 200, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, $aOULIST)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$MUWUID = GUICtrlCreateInput("", 15, 96, 200, 21)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$NameContact = GUICtrlCreateInput("Info des IWO", 230, 40, 180, 21)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$MailAdress = GUICtrlCreateInput("info-IOW@Domain.com", 230, 96, 180, 21)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
$Group1 = GUICtrlCreateGroup("", 16, 128, 401, 41)
$sendas = GUICtrlCreateRadio("Senden als Kontakt", 47, 140, 121, 17)
$sendon = GUICtrlCreateRadio("Senden im Auftrag des Kontaktes", 218, 140, 185, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$OK = GUICtrlCreateButton("OK", 336, 184, 75, 25)
$Cancle = GUICtrlCreateButton("Abbrechen", 240, 184, 75, 25)
$Label2 = GUICtrlCreateLabel("Name des 'send as' Kontaktes", 230, 20, 147, 17)
$Label3 = GUICtrlCreateLabel("E-Mail Adresse des 'send as' Kontaktes", 230, 72, 196, 17)
$Label4 = GUICtrlCreateLabel("UID des zu berechtigten Users", 15, 72, 180, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
In diesem Fall hilft Dir vermutlich das Lesen der Hilfe weiter.
Dort steht, wie die entsprechenden Controls abgefragt werden müssen.
Du musst also lediglich das von i2c gepostete Beispiel anpassen und die Abfrage der Radio-Buttons hinzufügen.
"Bei [...] Radiobuttons können mehrere Statuse als
$GUI_FOCUS
[/autoit]und
[autoit]$GUI_CHECKED
[/autoit]zurückgegeben werden. So ist z. B.
[autoit]BitAnd(GUICtrlRead($Item),$GUI_CHECKED)
[/autoit]zu verwenden um zu sehen ob ein Control markiert ist."
(Quelle: http://translation.autoit.de/onlinehilfe/fu…GUICtrlRead.htm)