Pflichtfelder (Radio Button, Edit Feld) vor dem Absenden des Formulars auf Inhalt prüfen

  • Hallo Zusammen,

    habe hier ein Script, welches ein internes Umfragetool mit Radiobuttons und Edit Feldern werden soll! (ist gob fertig)
    Diese Werte sollen dann in eine Excel Datei oder DB geschrieben werden! (sollte auch nicht das problem sein :))
    Nun komme ich nicht auf die Lösung, wie man alle Felder prüft, dass diese auch ausgefüllt sind ...

    Kann mir da bitte einer von euch einen Tipp geben :)

    Eventuell auch beim erstellen der Radio Button .....

    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 110
    $left_s2 = 530

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness 1 ", 90, 150, 400, 200)
    $radio11 = GUICtrlCreateRadio("1",$left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $radio12 = GUICtrlCreateRadio("2",$left_s1 + 30,$top_1, 30, 20)
    $radio13 = GUICtrlCreateRadio("3",$left_s1 + 60,$top_1, 30, 20)
    $radio14 = GUICtrlCreateRadio("4",$left_s1 + 90,$top_1, 30, 20)
    $radio15 = GUICtrlCreateRadio("5",$left_s1 + 120,$top_1, 30, 20)
    $radio16 = GUICtrlCreateRadio("6",$left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 110, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Objektivität / Fairness 2 ", 90, 380, 400, 200)
    $radio21 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio22 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $radio23 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $radio24 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $radio25 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $radio26 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 110, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Objektivität / Fairness 3 ", 90, 610, 400, 200)
    $radio31 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio32 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $radio33 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $radio34 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $radio35 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $radio36 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 110, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Objektivität / Fairness 4 ", 510, 150, 400, 200)
    $radio41 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio42 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $radio43 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $radio44 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $radio45 = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $radio46 = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 530, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Objektivität / Fairness 5 ", 510, 380, 400, 200)
    $radio51 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio52 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $radio53 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $radio54 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $radio55 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $radio56 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 530, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Objektivität / Fairness 6 ", 510, 610, 400, 200)
    $radio61 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio62 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $radio63 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $radio64 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $radio65 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $radio66 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 530, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton("Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    $wert1 = GUICtrlRead($TL_Combo)

    [/autoit] [autoit][/autoit] [autoit]

    _radio_edit($radio11, $radio12, $radio13, $radio14, $radio15, $radio16, $edit11)

    [/autoit] [autoit][/autoit] [autoit]

    $f1 = $x & "|" & $wert_edit
    ;_radio_edit($radio21, $radio22, $radio23, $radio24, $radio25, $radio26, $edit21)
    ;MsgBox(0,"",$x & @CRLF & $wert_edit)
    ;$f2 = $x & "|" & $wert_edit
    ;_radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)
    ;MsgBox(0,"",$x & @CRLF & $wert_edit)
    ;$f3 = $x & "|" & $wert_edit
    ;MsgBox(0,"",$wert1 & @crlf & $f1 & @CRLF & $f2 & @CRLF & $f3)
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    $x = ""
    $wert_edit = ""

    [/autoit] [autoit][/autoit] [autoit]

    $wert_edit = GUICtrlRead($edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    ; Group mit $radio1 bis $radio6
    For $i = $radio_x1 To $radio_x6
    If GUICtrlRead($i) = $GUI_CHECKED Then
    Switch $i
    Case $radio_x1
    $x = 1
    Case $radio_x2
    $x = 2
    Case $radio_x3
    $x = 3
    Case $radio_x4
    $x = 4
    Case $radio_x5
    $x = 5
    Case $radio_x6
    $x = 6
    EndSwitch
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $x & $wert_edit

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit]

    Danke

    Gruß gmmg ;)

  • Schau dir mal GUICtrlRead an und für eine Tabelle mit Variablen für den Status eines Controls GUICtrlSetState.
    Du musst wohl jedes Control einzeln prüfen wie dessen Status ist.
    Für die RadioButtons würde ich am besten pro Gruppe deren Handle/Identifizierer in ein Array speichern. Somit kannst du mittels einer
    Schleife den Status prüfen und musst nicht für jeden Radio Button eine If-Abfrage erstellen.

    Und bei den Editboxen einfach den Inhalt prüfen ob leer oder/und ob min. Anz. an Zeichen erreicht. Auch wieder denkbar mit einem Array.

    Edit:
    Was ich noch erwähnen wollte, wenn ich dein Programm starte dann geht die GUI über meinen unteren Bildschirmrand. Ich sehe nur noch den Pfeil nach unten des Scrollbalkens von den letzten beiden Editboxen (3,6).
    Den Knopf "Formular Absenden" sehe ich somit nichtmehr.
    Meine Auflösung ist 1366x768.

    ~IRC: irc.afterworkchat.de #autoit

    Einmal editiert, zuletzt von Photon (6. November 2013 um 13:12)

  • Hallo Photon,

    das mit der Auflösung ist noch nicht angepasst ...
    Habe aber meine Abfrage, ob alle Felder gefüllt sind mal gebastelt!

    Ich schreibe praktisch die werte in ein Array, wenn hier ein Feld oder eine Radio nicht aktiviert wurde, wird ins Array ein Wert "leer" geschrieben!
    Nun prüfe ich mit ArraySearch ob im Array ein Eintrag mit " leer" vorkommt! Wenn es vorkommt, wird das Array neu leer erzeugt und das Ganze wird neu geprüft, bis alle Felder gefüllt sind, erst dann geht es weiter im script ... :)

    [autoit]


    IF $feld = "leer" Then
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    Else
    MsgBox(0,"1 alles ok",$feld)
    ;_ArrayDisplay($avArray)
    Exit --> hier geht es dann weiter --> Daten in DB schreiben etc ...
    EndIf

    [/autoit]


    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 110
    $left_s2 = 530

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness 1 ", 90, 150, 400, 200)
    $radio11 = GUICtrlCreateRadio("1",$left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $radio12 = GUICtrlCreateRadio("2",$left_s1 + 30,$top_1, 30, 20)
    $radio13 = GUICtrlCreateRadio("3",$left_s1 + 60,$top_1, 30, 20)
    $radio14 = GUICtrlCreateRadio("4",$left_s1 + 90,$top_1, 30, 20)
    $radio15 = GUICtrlCreateRadio("5",$left_s1 + 120,$top_1, 30, 20)
    $radio16 = GUICtrlCreateRadio("6",$left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 110, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Objektivität / Fairness 2 ", 90, 380, 400, 200)
    $radio21 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio22 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $radio23 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $radio24 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $radio25 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $radio26 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 110, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Objektivität / Fairness 3 ", 90, 610, 400, 200)
    $radio31 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio32 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $radio33 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $radio34 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $radio35 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $radio36 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 110, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Objektivität / Fairness 4 ", 510, 150, 400, 200)
    $radio41 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio42 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $radio43 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $radio44 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $radio45 = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $radio46 = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 530, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Objektivität / Fairness 5 ", 510, 380, 400, 200)
    $radio51 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio52 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $radio53 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $radio54 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $radio55 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $radio56 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 530, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Objektivität / Fairness 6 ", 510, 610, 400, 200)
    $radio61 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio62 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $radio63 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $radio64 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $radio65 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $radio66 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 530, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton("Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    $feld = ""
    _pruefen()

    [/autoit] [autoit][/autoit] [autoit]

    IF $feld = "leer" Then
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    Else
    MsgBox(0,"1 alles ok",$feld)
    ;_ArrayDisplay($avArray)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _pruefen()

    [/autoit] [autoit][/autoit] [autoit]

    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayAdd($avArray, $wert_TL)

    [/autoit] [autoit][/autoit] [autoit]

    _radio_edit($radio11, $radio12, $radio13, $radio14, $radio15, $radio16, $edit11)
    _radio_edit($radio21, $radio22, $radio23, $radio24, $radio25, $radio26, $edit21)
    _radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)
    _radio_edit($radio41, $radio42, $radio43, $radio44, $radio45, $radio46, $edit41)
    _radio_edit($radio51, $radio52, $radio53, $radio54, $radio55, $radio56, $edit51)
    _radio_edit($radio61, $radio62, $radio63, $radio64, $radio65, $radio66, $edit61)
    ;_radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)

    [/autoit] [autoit][/autoit] [autoit]

    $feld = ""
    _ArraySearch($avArray, "leer")

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ')
    $feld = "leer"
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $feld
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    $x = ""
    $wert_edit = ""

    [/autoit] [autoit][/autoit] [autoit]

    $wert_edit = GUICtrlRead($edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    ; Group mit $radio1 bis $radio6
    For $i = $radio_x1 To $radio_x6
    If GUICtrlRead($i) = 1 Then;$GUI_CHECKED Then
    Switch $i
    Case $radio_x1
    $x = 1
    Case $radio_x2
    $x = 2
    Case $radio_x3
    $x = 3
    Case $radio_x4
    $x = 4
    Case $radio_x5
    $x = 5
    Case $radio_x6
    $x = 6
    EndSwitch
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If $x = "" or $wert_edit = "" Then
    _ArrayAdd($avArray, "leer")
    Else
    _ArrayAdd($avArray, $x & "|" & $wert_edit)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • Hallo gmmg,

    ich würde es wie im Spoiler unten lösen. Habe aber noch nicht alles von jetzt überflüssigen Variablen gesäubert. Mach ich vielleicht noch in einem Edit.
    Noch ein, zwei Tipps.
    Du solltes so wenig wie möglich globale Variablen nutzen.
    Desweiteren sollte man für die Variablendeklaration DIM nicht mehr nutzen.

    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 110
    $left_s2 = 530

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global $RadioButtonGroups[6][6]

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness 1 ", 90, 150, 400, 200)

    [/autoit] [autoit][/autoit] [autoit]

    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 110, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Objektivität / Fairness 2 ", 90, 380, 400, 200)
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 110, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Objektivität / Fairness 3 ", 90, 610, 400, 200)
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 110, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Objektivität / Fairness 4 ", 510, 150, 400, 200)
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 530, 235, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Objektivität / Fairness 5 ", 510, 380, 400, 200)
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 530, 465, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Objektivität / Fairness 6 ", 510, 610, 400, 200)
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 530, 690, 360, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,200,130,30, 0x0C00 )

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    If _pruefen( $RadioButtonGroups ) = True Then
    MsgBox(0,"1 alles ok", ":)" )
    Exit
    Else
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Hier musst du natürlich noch die Überprüfung der Editboxen rein machen.
    ;
    Func _pruefen( $RadBtnGrps )

    [/autoit] [autoit][/autoit] [autoit]

    Local $AllNeededDataFound = False

    [/autoit] [autoit][/autoit] [autoit]

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True
    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $AllNeededDataFound
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfArray - 1
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked
    EndFunc

    [/autoit]

    ~IRC: irc.afterworkchat.de #autoit

  • Hallo Photon,

    danke für die Lösung und deine Mühe :o) Gefällt mir sehr gut!

    In meiner alten Version (folgend nochmal) habe ich die Daten gleich in ein Array (siehe Anhang Array.png) geschrieben, um die dann aus diesem weiterverarbeiten zu können!
    Zum Beispiel dann aus dem Array in eine DB oder Excel Sheet schreiben ...
    An welcher Stelle müsste man die Abfrage jetzt einbauen, um herauszufinden, welcher Radio Button aktiv ist, um die in ein Array zu schreiben?

    Wie könnte man das hier denn mit deiner Version (hab da mal noch paar Radios und Edit Felder ergänzt) lösen?

    neue Version ...

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

    [/autoit] [autoit][/autoit] [autoit]

    Global $RadioButtonGroups[7][7]

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit71 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit81 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit91 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit101 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    If _pruefen( $RadioButtonGroups ) = True Then
    MsgBox(0,"1 alles ok", ":)" )
    Exit
    Else
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Hier musst du natürlich noch die Überprüfung der Editboxen rein machen.
    ;
    Func _pruefen( $RadBtnGrps )

    [/autoit] [autoit][/autoit] [autoit]

    Local $AllNeededDataFound = False

    [/autoit] [autoit][/autoit] [autoit]

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True
    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $AllNeededDataFound
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfArray - 1
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]


    alte Version ...

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000) ; will create a dialog box that when displayed is centered
    $label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    $label_2 = GUICtrlCreateLabel("Ansprechpartner, der bewertet werden soll: ",390,103,300,20);
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $radio11 = GUICtrlCreateRadio("1",$left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $radio12 = GUICtrlCreateRadio("2",$left_s1 + 30,$top_1, 30, 20)
    $radio13 = GUICtrlCreateRadio("3",$left_s1 + 60,$top_1, 30, 20)
    $radio14 = GUICtrlCreateRadio("4",$left_s1 + 90,$top_1, 30, 20)
    $radio15 = GUICtrlCreateRadio("5",$left_s1 + 120,$top_1, 30, 20)
    $radio16 = GUICtrlCreateRadio("6",$left_s1 + 150,$top_1, 30, 20)
    $edit11 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $radio21 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio22 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $radio23 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $radio24 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $radio25 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $radio26 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit21 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $radio31 = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio32 = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $radio33 = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $radio34 = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $radio35 = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $radio36 = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit31 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $radio41 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio42 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $radio43 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $radio44 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $radio45 = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $radio46 = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit41 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $radio51 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $radio52 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $radio53 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $radio54 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $radio55 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $radio56 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit51 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $radio61 = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $radio62 = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $radio63 = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $radio64 = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $radio65 = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $radio66 = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit61 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $radio71 = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $radio72 = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $radio73 = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $radio74 = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $radio75 = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $radio76 = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit71 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit81 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit91 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit101 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton("Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    $feld = ""
    _pruefen()

    [/autoit] [autoit][/autoit] [autoit]

    IF $feld = "leer" Then
    MsgBox(0,"Info","...Bitte alle Felder ausfüllen!...")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    ;_ArrayDisplay($avArray)
    Else
    MsgBox(0,"1 alles ok",$feld)
    _ArrayDisplay($avArray)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _pruefen()

    [/autoit] [autoit][/autoit] [autoit]

    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayAdd($avArray, $wert_TL)

    [/autoit] [autoit][/autoit] [autoit]

    _radio_edit($radio11, $radio12, $radio13, $radio14, $radio15, $radio16, $edit11)
    _radio_edit($radio21, $radio22, $radio23, $radio24, $radio25, $radio26, $edit21)
    _radio_edit($radio31, $radio32, $radio33, $radio34, $radio35, $radio36, $edit31)
    _radio_edit($radio41, $radio42, $radio43, $radio44, $radio45, $radio46, $edit41)
    _radio_edit($radio51, $radio52, $radio53, $radio54, $radio55, $radio56, $edit51)
    _radio_edit($radio61, $radio62, $radio63, $radio64, $radio65, $radio66, $edit61)
    _radio_edit($radio71, $radio72, $radio73, $radio74, $radio75, $radio76, $edit71)
    _radio_edit("no_rb","no_rb","no_rb","no_rb","no_rb","no_rb", $edit81)
    _radio_edit("no_rb","no_rb","no_rb","no_rb","no_rb","no_rb", $edit91)
    _radio_edit("no_rb","no_rb","no_rb","no_rb","no_rb","no_rb", $edit101)

    [/autoit] [autoit][/autoit] [autoit]

    $feld = ""
    _ArraySearch($avArray, "leer")

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ')
    $feld = "leer"
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $feld
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _radio_edit($radio_x1,$radio_x2, $radio_x3 , $radio_x4, $radio_x5, $radio_x6, $edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    $x = ""
    $wert_edit = ""

    [/autoit] [autoit][/autoit] [autoit]

    $wert_edit = GUICtrlRead($edit_x)

    [/autoit] [autoit][/autoit] [autoit]

    ; Group mit $radio1 bis $radio6
    For $i = $radio_x1 To $radio_x6
    If GUICtrlRead($i) = 1 Then ;$GUI_CHECKED Then
    Switch $i
    Case $radio_x1
    $x = 1
    Case $radio_x2
    $x = 2
    Case $radio_x3
    $x = 3
    Case $radio_x4
    $x = 4
    Case $radio_x5
    $x = 5
    Case $radio_x6
    $x = 6
    EndSwitch
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    ;Return $x & $wert_edit

    [/autoit] [autoit][/autoit] [autoit]

    If $x = "" or $wert_edit = "" or $radio_x1 = "no_rb" And $wert_edit = "" Then
    _ArrayAdd($avArray, "leer")
    Else
    _ArrayAdd($avArray, $x & "|" & $wert_edit)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _set_entries($TL)
    $z = 0
    Local $sFilePath1 = @ScriptDir & "\TL_Bewertung.xlsx" ;This file should already exist
    Local $oExcel = _ExcelBookOpen($sFilePath1)

    [/autoit] [autoit][/autoit] [autoit]

    If @error = 1 Then
    MsgBox(0, "Error!", "Unable to Create the Excel Object")
    Exit
    ElseIf @error = 2 Then
    MsgBox(0, "Error!", "File does not exist - Shame on you!")
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $aArray = _ExcelSheetList($oExcel)
    ;_ArrayDisplay($aArray)
    Local $iIndex = _ArraySearch($aArray, $TL, 0, 0, 0, 1)
    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    _ExcelSheetAddNew($oExcel, $TL)
    $aArray = _ExcelSheetList($oExcel)
    ;_ArrayDisplay($aArray)
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ' & $iIndex & ".")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    For $i = $aArray[0] To 1 Step -1 ;Work backwards through loop

    [/autoit] [autoit][/autoit] [autoit]

    IF $aArray[$i] = $TL Then

    [/autoit] [autoit][/autoit] [autoit]

    _ExcelSheetActivate($oExcel, $aArray[$i]) ;Using the String Name returned in the Array Elements
    MsgBox(0, "ActiveSheet", "The Active Sheet should be:" & @CRLF & $aArray[$i])
    _ExcelRowInsert($oExcel, 2, 1) ;Insert 1 Row at row 1
    _ExcelWriteCell($oExcel, "OT4M", 2, 1) ;Write to the Cell
    _ExcelWriteCell($oExcel, "Bewertung33", 2, 2) ;Write to the Cell
    $z = 1
    ExitLoop
    EndIf
    Next
    ;~ If $z = 0 then
    ;~ _ExcelSheetAddNew($oExcel, $TL)
    ;~ _ExcelSheetActivate($oExcel,$TL) ;Using the String Name returned in the Array Elements
    ;~ MsgBox(0, "ActiveSheet", "The Active Sheet should be:" & @CRLF & $aArray[$i])
    ;~ _ExcelRowInsert($oExcel, 2, 1) ;Insert 1 Row at row 1
    ;~ _ExcelWriteCell($oExcel, @username, 2, 1) ;Write to the Cell
    ;~ _ExcelWriteCell($oExcel, "Bewertung3", 2, 2) ;Write to the Cell
    ;~ EndIf
    _ExcelBookClose($oExcel, 1, 0)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Danke

    gruß gmmg :thumbup:

  • Hallo,

    habe das Script jetzt so weit, dass die Radiobuttons mit den Werten in ein Array zum Weiterverarbeiten geschrieben werden!
    Wie macht man das jetzt mit den Edit Boxen? Genauso, wie mit den Radios? hab grad schon versucht, das auslesen mit in die Func _is_Radio_Button_Of_Group_Checked einzubinden, was aber Käse ist, weil ich ja weniger Radio Groups habe wie die Edit Boxen!

    Spoiler anzeigen
    [autoit]


    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfArray - 1
    ;MsgBox(0,"",$Lc)
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    ;IF $Lc = 0 Then $wert_edit = GUICtrlRead($edit1)
    ;IF $Lc = 1 Then $wert_edit = GUICtrlRead($edit2)
    ;IF $Lc = 2 Then $wert_edit = GUICtrlRead($edit3)
    ;IF $Lc = 3 Then $wert_edit = GUICtrlRead($edit4)
    ;IF $Lc = 4 Then $wert_edit = GUICtrlRead($edit5)
    ;IF $Lc = 5 Then $wert_edit = GUICtrlRead($edit6)
    ;IF $Lc = 6 Then $wert_edit = GUICtrlRead($edit7)
    ;MsgBox(0,"",$wert_edit)
    ;MsgBox(0,"",$RadioButtonChecked & @CRLF & $GroupNr + 1 & @CRLF & $Lc + 1)
    ;_ArrayAdd($avArray, $GroupNr + 1 & "|" & $Lc + 1 & $wert_edit)
    _ArrayAdd($avArray, $GroupNr + 1 & "|" & $Lc + 1)
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked
    EndFunc

    [/autoit]


    Version mit Array ...

    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

    [/autoit] [autoit][/autoit] [autoit]

    Global $RadioButtonGroups[7][6]

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $edit1 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit2 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit3 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit4 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit5 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit6 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit7 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit8 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit9 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit10 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    ;$wert_edit = ""
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...

    [/autoit] [autoit][/autoit] [autoit]

    If _pruefen( $RadioButtonGroups ) = True Then
    MsgBox(0,"1 alles ok", ":)" )
    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayAdd($avArray, $wert_TL)
    _ArrayDisplay($avArray)
    Exit
    Else
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Hier musst du natürlich noch die Überprüfung der Editboxen rein machen.
    ;
    Func _pruefen( $RadBtnGrps )

    [/autoit] [autoit][/autoit] [autoit]

    Local $AllNeededDataFound = False

    [/autoit] [autoit][/autoit] [autoit]

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True

    [/autoit] [autoit][/autoit] [autoit]

    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $AllNeededDataFound
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next
    ;MsgBox(0,"",$RadioButtonChecked)
    Return $RadioButtonChecked
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfArray - 1
    ;MsgBox(0,"",$Lc)
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    _ArrayAdd($avArray, $GroupNr + 1 & "|" & $Lc + 1)
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked
    EndFunc

    [/autoit]

    Danke Vorab für die Unterstützung :)

    gruß gmmg

  • Entschuldige. Die Antwort hat etwas gedauert.
    Ich hab dir den Quelltext mal für die RadioButtons abgeändert. Jetzt kannst du mit den Werten weiterarbeiten.
    Versuch das mit den Editboxen nochmal selber.
    Dabei kannst du dich an der Lösung für die Radiobuttons orientieren.
    Um zu sehen was geändert wurde kannst du z.B. ein Programm wie Winmerge nutzen.

    Viel Erfolg.

    Spoiler anzeigen
    [autoit]


    #include <Excel.au3>
    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $x, $wert_edit, $radio_x1, $radio_x2, $radio_x3, $radio_x4,$radio_x5,$radio_x6
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    $TL_Combo = GUICtrlCreateCombo("",600, 100,100,20) ; create first item
    $Label_1 = GUICtrlCreateLabel("Feedback an die Teamleitung und das Qualitätsmanagement",260,30,@DesktopWidth,50)
    GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    GUICtrlSetData($TL_Combo, "Teamleiter1|Teamleiter2|Teamleiter3|Teamleiter4|Teamleiter5", "Teamleiter1") ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

    [/autoit] [autoit][/autoit] [autoit]

    Global $RadioButtonGroups[7][6]

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $edit1 = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $edit2 = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $edit3 = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $edit4 = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $edit5 = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $edit6 = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $edit7 = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    Global $CheckedRadioButtonsNum[7] ; Hinzugefügt

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    $edit8 = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    $edit9 = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    $edit10 = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Button_1 = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo

    [/autoit] [autoit][/autoit] [autoit]

    Case $Button_1
    ;$wert_edit = ""
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    ; Wozu ein leeres Array? In Zeile 7 hast verwendest du den Namen bereits für ein Array.

    [/autoit] [autoit][/autoit] [autoit]

    If _pruefen( $RadioButtonGroups, $CheckedRadioButtonsNum ) = True Then
    MsgBox(0,"1 alles ok", ":)" )
    $wert_TL = GUICtrlRead($TL_Combo)
    _ArrayDisplay( $CheckedRadioButtonsNum, "Gesetzte Radio Button Nummern Liste" )
    ;_ArrayAdd($avArray, $wert_TL) ; Wie du siehst braucht man nicht unbedingt _ArrayAdd um die Werte in einem Array zu speichern
    ;_ArrayDisplay($avArray)
    Exit
    Else
    MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Hier musst du natürlich noch die Überprüfung der Editboxen rein machen.
    ;
    Func _pruefen( $RadBtnGrps, ByRef $ChckdRadBtnsNums )

    [/autoit] [autoit][/autoit] [autoit]

    Local $AllNeededDataFound = False

    [/autoit] [autoit][/autoit] [autoit]

    If _get_all_Radio_Buttons_Group_State( $RadBtnGrps, $ChckdRadBtnsNums ) = True Then
    $AllNeededDataFound = True
    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $AllNeededDataFound
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _get_all_Radio_Buttons_Group_State( $RadBtnGrps, ByRef $ChckdRadBtnsNums )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    Local $TempRes = -1

    [/autoit] [autoit][/autoit] [autoit]

    For $GroupNr = 0 To $SizeOfRadBtnArr - 1
    $TempRes = _get_Radio_Button_Of_Group_Checked( $RadBtnGrps, $GroupNr, $ChckdRadBtnsNums )

    [/autoit] [autoit][/autoit] [autoit]

    If $TempRes > -1 Then
    $ChckdRadBtnsNums[$GroupNr] = $TempRes
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next
    Return $RadioButtonChecked
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft in einer Gruppe von Radio Buttons ob einer gesetzt ist und gibt die Nummer des gesetzten zurück.
    ;
    Func _get_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr, ByRef $CheckedButtons )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $NumOfCheckedRadBtn = -1

    [/autoit] [autoit][/autoit] [autoit]

    For $BtnNr = 0 To $SizeOfArray - 1
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$BtnNr] ) = $GUI_CHECKED Then
    $NumOfCheckedRadBtn = $BtnNr ; Wenn du hier $BtnNr + 1 machst erhältst du die Nummer des Buttons wie sie in der GUI angezeigt wird.
    ; Also nicht 0,1,2,3,4,5 sonder 1,2,3,4,5,6. Probiers einfach aus.
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $NumOfCheckedRadBtn
    EndFunc

    [/autoit]

    ~IRC: irc.afterworkchat.de #autoit

    • Offizieller Beitrag

    Mal unabhängig von der Fragestellung:
    Wenn schon Arrays für die Control verwendet werden, warum wird dieser Vorteil sofort wieder über Bord geschmissen und trotzdem jedes Control einzeln erstellt? Dazu nimmt man ganz performant ein For-Schleife und ändert x, y in Abhängigkeit vom Schleifenzähler. Die kpl. Controlerstellung läßt sich so auf ca. 10 Zeilen Code reduzieren.

  • Hallo Zusammen,

    hier nochmal mein script, welches auch erstmal funktioniert und die Daten entsprechend in eine MySQL Tabelle schreibt!
    Hab noch mal paar Fragen zum vereinfachen des Quellcodes im Case Bereich!

    Wie kann ich es vereinfacht machen, dass beim auswählen eines der radiobuttons einer group sich ein bild ändert ..
    derzeit hab ich für jeden radiobutton ein Case erstellt, was natürlich funktioniert, aber nicht sinnvoll ist ...

    Eventuell kann nochmal einer drüber schauen und mir noch einen Tipp geben ...

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <File.au3>
    #include <mysql/mysql.au3>
    #include <array.au3>
    #include <Date.au3>
    #include <String.au3>
    #include <D:\Data\scripte\AD_1.3.0.0_Functions\AD.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Local $MysqlConn, $department , $result, $result01, $TL_ini, $TL, $aUser01
    Local $wert_edit
    Local $avArray[1]

    [/autoit] [autoit][/autoit] [autoit]

    ;_TL_auslesen() ; die Funktion hab ich mal entfernt ...
    ;$standardCombo = StringSplit ($TL,"|")
    GUICreate("... Feedback Tool ...",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered
    ;$iPic = GUICtrlCreatePic(@ScriptDir & "\pic\hg.jpg", 0, 0, @DesktopWidth, @DesktopHeight)
    ;GUICtrlSetState($iPic, $GUI_DISABLE)
    ;$TL_Combo = GUICtrlCreateCombo("",570, 90,150,20) ; create first item
    ;$Label_1 = GUICtrlCreateLabel("... Feedback Tool ...",520,30,260,50)
    ;GUICtrlSetFont($Label_1,22,120, 0, "Arial")
    ;GUICtrlSetData($TL_Combo, $TL,$standardCombo[1]) ; add other item snd set a new default
    ;----------erste spalte ----------------------------------------------
    $top_1 = 190
    $top_2 = 420
    $top_3 = 640
    $left_s1 = 100
    $left_s2 = 510
    $left_s3 = 920
    $group_w = 350
    $group_h = 200
    $group_ht = 150

    [/autoit] [autoit][/autoit] [autoit]

    Global $RadioButtonGroups[7][6]
    Global $EditGroups [10][1]
    #Region Groups
    GUICtrlCreateGroup("1. Objektivität / Fairness ", 70, 150, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[0][0] = GUICtrlCreateRadio( "1", $left_s1 + 00,$top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[0][1] = GUICtrlCreateRadio( "2", $left_s1 + 30,$top_1, 30, 20)
    $RadioButtonGroups[0][2] = GUICtrlCreateRadio( "3", $left_s1 + 60,$top_1, 30, 20)
    $RadioButtonGroups[0][3] = GUICtrlCreateRadio( "4", $left_s1 + 90,$top_1, 30, 20)
    $RadioButtonGroups[0][4] = GUICtrlCreateRadio( "5", $left_s1 + 120,$top_1, 30, 20)
    $RadioButtonGroups[0][5] = GUICtrlCreateRadio( "6", $left_s1 + 150,$top_1, 30, 20)
    $pic01 = GUICtrlCreatePic("", $left_s1 + 200, $top_1 -5, 44, 44)
    $EditGroups[0][0] = GUICtrlCreateEdit("", 90, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("2. Kompetenz in seiner Aufgabe ", 70, 380, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[1][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[1][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_2, 30, 20)
    $RadioButtonGroups[1][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_2, 30, 20)
    $RadioButtonGroups[1][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_2, 30, 20)
    $RadioButtonGroups[1][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_2, 30, 20)
    $RadioButtonGroups[1][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_2, 30, 20)
    $pic02 = GUICtrlCreatePic("", $left_s1 + 200, $top_2 -5, 44, 44)
    $EditGroups[1][0] = GUICtrlCreateEdit("", 90, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("3. Verständnis für Anliegen/Probleme ", 70, 610, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[2][0] = GUICtrlCreateRadio("1",$left_s1 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[2][1] = GUICtrlCreateRadio("2",$left_s1 + 30, $top_3, 30, 20)
    $RadioButtonGroups[2][2] = GUICtrlCreateRadio("3",$left_s1 + 60, $top_3, 30, 20)
    $RadioButtonGroups[2][3] = GUICtrlCreateRadio("4",$left_s1 + 90, $top_3, 30, 20)
    $RadioButtonGroups[2][4] = GUICtrlCreateRadio("5",$left_s1 + 120, $top_3, 30, 20)
    $RadioButtonGroups[2][5] = GUICtrlCreateRadio("6",$left_s1 + 150, $top_3, 30, 20)
    $pic03 = GUICtrlCreatePic("", $left_s1 + 200, $top_3 -5, 44, 44)
    $EditGroups[2][0] = GUICtrlCreateEdit("", 90, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;----------zweite spalte ----------------------------------------------
    GUICtrlCreateGroup("4. Hilfsbereitschaft ", 475, 150, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[3][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[3][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_1, 30, 20)
    $RadioButtonGroups[3][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_1, 30, 20)
    $RadioButtonGroups[3][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_1, 30, 20)
    $RadioButtonGroups[3][4] = GUICtrlCreateRadio("5", $left_s2 + 120, $top_1, 30, 20)
    $RadioButtonGroups[3][5] = GUICtrlCreateRadio("6", $left_s2 + 150, $top_1, 30, 20)
    $pic04 = GUICtrlCreatePic("", $left_s2 + 200, $top_1 -5, 44, 44)
    $EditGroups[3][0] = GUICtrlCreateEdit("", 495, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("5. Loyalität ", 475, 380, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[4][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_2, 30, 20, $WS_GROUP)
    $RadioButtonGroups[4][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_2, 30, 20)
    $RadioButtonGroups[4][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_2, 30, 20)
    $RadioButtonGroups[4][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_2, 30, 20)
    $RadioButtonGroups[4][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_2, 30, 20)
    $RadioButtonGroups[4][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_2, 30, 20)
    $pic05 = GUICtrlCreatePic("", $left_s2 + 200, $top_2 -5, 44, 44)
    $EditGroups[4][0] = GUICtrlCreateEdit("", 495, 465, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("6. Fähigkeit zum Vermitteln von Zusammenhängen ", 475, 610, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[5][0] = GUICtrlCreateRadio("1", $left_s2 + 00, $top_3, 30, 20, $WS_GROUP)
    $RadioButtonGroups[5][1] = GUICtrlCreateRadio("2", $left_s2 + 30, $top_3, 30, 20)
    $RadioButtonGroups[5][2] = GUICtrlCreateRadio("3", $left_s2 + 60, $top_3, 30, 20)
    $RadioButtonGroups[5][3] = GUICtrlCreateRadio("4", $left_s2 + 90, $top_3, 30, 20)
    $RadioButtonGroups[5][4] = GUICtrlCreateRadio("5", $left_s2 + 120,$top_3, 30, 20)
    $RadioButtonGroups[5][5] = GUICtrlCreateRadio("6", $left_s2 + 150,$top_3, 30, 20)
    $pic06 = GUICtrlCreatePic("", $left_s2 + 200, $top_3 -5, 44, 44)
    $EditGroups[5][0] = GUICtrlCreateEdit("", 495, 690, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    ;----------dritte spalte ----------------------------------------------
    GUICtrlCreateGroup("7. Motivation ", 880, 150, $group_w, $group_h)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $RadioButtonGroups[6][0] = GUICtrlCreateRadio("1", $left_s3 + 00, $top_1, 30, 20, $WS_GROUP)
    $RadioButtonGroups[6][1] = GUICtrlCreateRadio("2", $left_s3 + 30, $top_1, 30, 20)
    $RadioButtonGroups[6][2] = GUICtrlCreateRadio("3", $left_s3 + 60, $top_1, 30, 20)
    $RadioButtonGroups[6][3] = GUICtrlCreateRadio("4", $left_s3 + 90, $top_1, 30, 20)
    $RadioButtonGroups[6][4] = GUICtrlCreateRadio("5", $left_s3 + 120, $top_1, 30, 20)
    $RadioButtonGroups[6][5] = GUICtrlCreateRadio("6", $left_s3 + 150, $top_1, 30, 20)
    $pic07 = GUICtrlCreatePic("", $left_s3 + 200, $top_1 -5, 44, 44)
    $EditGroups[6][0] = GUICtrlCreateEdit("", 900, 235, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("8. Was ist aus deiner Sicht besonders positiv? ", 880, 380, $group_w, $group_ht)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $EditGroups[7][0] = GUICtrlCreateEdit("", 900, 410, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("9. Was ist aus deiner Sicht besonders negativ? ", 880, 560, $group_w, $group_ht)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $EditGroups[8][0] = GUICtrlCreateEdit("", 900, 590, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateGroup("10. weitere Anmerkungen! ", 880, 740, $group_w, $group_ht)
    GUICtrlSetFont(-1,10,120, 0, "Arial")
    $EditGroups[9][0] = GUICtrlCreateEdit("", 900, 770, 310, 97)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
    #EndRegion Groups

    [/autoit] [autoit][/autoit] [autoit]

    $Button_Absenden = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $TL_Combo
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[0][0]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[0][1]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[0][2]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[0][3]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[0][4]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[0][5]
    GUICtrlSetImage($pic01, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[1][0]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[1][1]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[1][2]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[1][3]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[1][4]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[1][5]
    GUICtrlSetImage($pic02, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[2][0]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[2][1]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[2][2]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[2][3]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[2][4]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[2][5]
    GUICtrlSetImage($pic03, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[3][0]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[3][1]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[3][2]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[3][3]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[3][4]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[3][5]
    GUICtrlSetImage($pic04, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[4][0]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[4][1]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[4][2]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[4][3]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[4][4]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[4][5]
    GUICtrlSetImage($pic05, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[5][0]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[5][1]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[5][2]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[5][3]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[5][4]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[5][5]
    GUICtrlSetImage($pic06, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $RadioButtonGroups[6][0]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM01.gif")
    Case $RadioButtonGroups[6][1]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM02.gif")
    Case $RadioButtonGroups[6][2]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM03.gif")
    Case $RadioButtonGroups[6][3]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM04.gif")
    Case $RadioButtonGroups[6][4]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM05.gif")
    Case $RadioButtonGroups[6][5]
    GUICtrlSetImage($pic07, @ScriptDir & "\pic\SM06.gif")
    ;-------------------------------------------------------------
    Case $Button_Absenden
    $wert_edit = ""
    $feld = ""
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...

    [/autoit] [autoit][/autoit] [autoit]

    If _pruefen( $RadioButtonGroups ) = True Then
    ;MsgBox(0,"Radio 2 alles ok", ":)" )
    ;_ArrayDisplay($avArray)
    ;Exit

    [/autoit] [autoit][/autoit] [autoit]

    ;---begin abfrage Edit box------
    _editbox()
    _av_array_Search()
    ;MsgBox(0,"", $feld)

    [/autoit] [autoit][/autoit] [autoit]

    IF $feld = "leer" Then
    MsgBox(0,"Edit Info","...Bitte alle Felder ausfüllen!...")
    ;_ArrayDisplay($avArray)
    Local $avArray[1] ;wenn nicht alle Felder gefüllt sind erstelle leeres Array ...
    ;_ArrayDisplay($avArray)
    Else
    ;MsgBox(0,"1 alles ok",$feld)
    ;$wert_TL = GUICtrlRead($TL_Combo)
    ;If $wert_TL = "NotFound" Or $wert_TL = "" Then
    ; MsgBox(0,"Hinweis","kein Teamleiter ausgewählt oder keine Auswahl verfügbar!")
    ;Else
    MsgBox(0,"1 alles ok","Die Daten werden übermittelt!")
    _ArrayAdd($avArray, "TL" & "|" & $wert_TL)
    _ArrayAdd($avArray, "User" & "|" & @username)
    ;_ArrayDisplay($avArray)
    _insert_db() ; eintrag in die DB
    _leeren() ; DB Variablen leeren
    Exit
    ;EndIf
    EndIf
    ;---end abfrage Edit box------

    [/autoit] [autoit][/autoit] [autoit]

    Else
    MsgBox(0,"Radio Info","...Bitte alle Felder ausfüllen!...")
    Local $AllNeededDataFound = False
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _pruefen( $RadBtnGrps )

    [/autoit] [autoit][/autoit] [autoit]

    Local $AllNeededDataFound = False

    [/autoit] [autoit][/autoit] [autoit]

    If _check_all_Radio_Buttons_State( $RadBtnGrps ) = True Then
    $AllNeededDataFound = True
    Else
    $AllNeededDataFound = False
    Return $AllNeededDataFound
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $AllNeededDataFound
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft >>> alle <<< Radio Button Gruppen ob ein RadioButton gesetzt ist.
    ;
    Func _check_all_Radio_Buttons_State( $RadBtnGrps )
    Local $SizeOfRadBtnArr = UBound( $RadBtnGrps )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfRadBtnArr - 1
    If _is_Radio_Button_Of_Group_Checked( $RadBtnGrps, $Lc ) = True Then
    $RadioButtonChecked = True
    Else
    $RadioButtonChecked = False
    ExitLoop
    EndIf
    Next
    ;MsgBox(0,"",$RadioButtonChecked)
    Return $RadioButtonChecked
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;
    ; Prüft ob innerhalb einer RadioButton Gruppe ein Radio Button gestzt ist.
    ;
    Func _is_Radio_Button_Of_Group_Checked( $RadioButtonArray, $GroupNr )
    Local $SizeOfArray = UBound( $RadioButtonArray, 2 )
    Local $RadioButtonChecked = False

    [/autoit] [autoit][/autoit] [autoit]

    For $Lc = 0 To $SizeOfArray - 1
    ;MsgBox(0,"",$Lc)
    If GUICtrlRead( $RadioButtonArray[$GroupNr][$Lc] ) = $GUI_CHECKED Then
    $RadioButtonChecked = True
    _ArrayAdd($avArray, "RadioBtn" & $GroupNr + 1 & "|" & $Lc + 1) ; schreibe RadioButton Werte ins Array
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Return $RadioButtonChecked

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _editbox()

    [/autoit] [autoit][/autoit] [autoit]

    Local $SizeOfEditArr = UBound( $EditGroups )
    For $LcEdit = 0 To $SizeOfEditArr - 1
    $wert_edit = GUICtrlRead($EditGroups[$LcEdit][0])
    IF $wert_edit = "" Then
    ;MsgBox(0,"Info","Bitte alle Felder ausfüllen")
    _ArrayAdd($avArray, "leer")
    Else
    ;MsgBox(0,"", $LcEdit + 1 & "|" & $wert_edit)
    _ArrayAdd($avArray, "EditFld" & $LcEdit + 1 & "|" & $wert_edit) ; schreibe Edit Werte ins Array
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _av_array_Search()

    [/autoit] [autoit][/autoit] [autoit]

    $feld = ""
    _ArraySearch($avArray, "leer")

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then
    ;MsgBox(0, "Not Found", 'was not found in the array.')
    Else
    ;MsgBox(0, "Found", 'was found in the array at position ')
    $feld = "leer"
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $feld

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _insert_db()

    [/autoit] [autoit][/autoit] [autoit]

    ;---MYSQL verbinden----
    ; db verbindungsvariablen
    $ipadd = ""
    $sname = ""
    $spasswort = ""
    $db = "db_tl_auswertung"

    [/autoit] [autoit][/autoit] [autoit]

    _MySQL_InitLibrary()
    If @error Then Exit MsgBox(0, "Fehler", "libmysql.dll nicht gefunden")

    [/autoit] [autoit][/autoit] [autoit]

    $MysqlConn = _MySQL_Init()

    [/autoit] [autoit][/autoit] [autoit]

    $connected = _MySQL_Real_Connect($MysqlConn,$ipadd,$sname,$spasswort,$db)
    If $connected = 0 Then
    $errno = _MySQL_errno($MysqlConn)
    MsgBox(0,"Fehler","Login Server ist nicht Erreichbar")
    Exit
    Endif

    [/autoit] [autoit][/autoit] [autoit]

    $s_Row_txt_t1 = StringSplit($avArray[1],"|") ; RadioBtn1
    $s_Row_txt_t2 = StringSplit($avArray[2],"|") ; RadioBtn2
    $s_Row_txt_t3 = StringSplit($avArray[3],"|") ; RadioBtn3
    $s_Row_txt_t4 = StringSplit($avArray[4],"|") ; RadioBtn4
    $s_Row_txt_t5 = StringSplit($avArray[5],"|") ; RadioBtn5
    $s_Row_txt_t6 = StringSplit($avArray[6],"|") ; RadioBtn6
    $s_Row_txt_t7 = StringSplit($avArray[7],"|") ; RadioBtn7
    $s_Row_txt_t8 = StringSplit($avArray[8],"|") ; EditFld1
    $s_Row_txt_t9 = StringSplit($avArray[9],"|") ; EditFld2
    $s_Row_txt_t10 = StringSplit($avArray[10],"|") ; EditFld3
    $s_Row_txt_t11 = StringSplit($avArray[11],"|") ; EditFld4
    $s_Row_txt_t12 = StringSplit($avArray[12],"|") ; EditFld5
    $s_Row_txt_t13 = StringSplit($avArray[13],"|") ; EditFld6
    $s_Row_txt_t14 = StringSplit($avArray[14],"|") ; EditFld7
    $s_Row_txt_t15 = StringSplit($avArray[15],"|") ; EditFld8
    $s_Row_txt_t16 = StringSplit($avArray[16],"|") ; EditFld9
    $s_Row_txt_t17 = StringSplit($avArray[17],"|") ; EditFld10
    $s_Row_txt_t18 = StringSplit($avArray[18],"|") ; TL
    ;MsgBox(0,"Team",$department[1])
    $s_Row_txt_t19 = $department[1] ; hier muss das Team rein
    $s_Row_txt_t20 = StringSplit($avArray[19],"|") ; User

    [/autoit] [autoit][/autoit] [autoit]

    ;Truncate tavle tl_auswertung;

    [/autoit] [autoit][/autoit] [autoit]

    Local $sQuery = "INSERT INTO tl_auswertung (`Objektivitaet_rdo`,`Objektivitaet_txt`," & _
    "`Aufgabenkompetenz_rdo`,`Aufgabenkompetenz_txt`," & _
    "`Verstaendnis_Anliegen_rdo`,`Verstaendnis_Anliegen_txt`," & _
    "`Hilfsbereitschaft_rdo`,`Hilfsbereitschaft_txt`," & _
    "`Loyalitaet_rdo`,`Loyalitaet_txt`," & _
    "`Zusammenhaenge_vermitteln_rdo`,`Zusammenhaenge_vermitteln_txt`," & _
    "`Motivation_rdo`,`Motivation_txt`," & _
    "`besonders_Positiv_txt`,`besonders_Negativ_txt`," & _
    "`Anmerkungen_txt`,`Teamleiter`," & _
    "`Team`,`Agent`,`Datum`) " & _
    "VALUES ('" & $s_Row_txt_t1[2] & "',"& _
    "'" & $s_Row_txt_t8[2] & "',"& _
    "'" & $s_Row_txt_t2[2] & "',"& _
    "'" & $s_Row_txt_t9[2] & "',"& _
    "'" & $s_Row_txt_t3[2] & "',"& _
    "'" & $s_Row_txt_t10[2] & "',"& _
    "'" & $s_Row_txt_t4[2] & "',"& _
    "'" & $s_Row_txt_t11[2] & "',"& _
    "'" & $s_Row_txt_t5[2] & "',"& _
    "'" & $s_Row_txt_t12[2] & "',"& _
    "'" & $s_Row_txt_t6[2] & "',"& _
    "'" & $s_Row_txt_t13[2] & "',"& _
    "'" & $s_Row_txt_t7[2] & "',"& _
    "'" & $s_Row_txt_t14[2] & "',"& _
    "'" & $s_Row_txt_t15[2] & "',"& _
    "'" & $s_Row_txt_t16[2] & "',"& _
    "'" & $s_Row_txt_t17[2] & "',"& _
    "'" & $s_Row_txt_t18[2] & "',"& _
    "'" & $s_Row_txt_t19 & "',"& _
    "'" & $s_Row_txt_t20[2] & "',"& _
    "'" & _NowDate() & "')"

    [/autoit] [autoit][/autoit] [autoit]

    ;ConsoleWrite($sQuery)
    ;MsgBox(0,"",$sQuery)
    _MySQL_Real_Query($MysqlConn, $sQuery)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _leeren()

    [/autoit] [autoit][/autoit] [autoit]

    $aRecords = ""
    $sQuery = ""

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; Verbindung beenden
    _MySQL_Close($MysqlConn)
    ; MYSQL beenden
    _MySQL_EndLibrary()

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Danke

    gruß gmmg :)

  • hallo Bugfix,

    funktioniert es dann denn auch, dass sich das Bild zur Laufzeit ändert, je nachdem, welchen RadioButton 1 bis RadioButton 6 einer Group gesetzt wird?

    Als Beispiel, wenn RadioButton 1 geklickt wird, soll Bild 1 zur laufzeit geändert werden, bei RadioButton 2 Bild 2 usw .. (siehe Bild)

    Gruß gmmg

    • Offizieller Beitrag

    Das geht alles. Ich mach gleich mal ein kleines Bsp.

    Aber was ich noch zeigen wollte: So nutzt man Arrays sinnvoll. Ich erstelle hier alle Groups mit Radio in einem Rutsch. Das sind 21 Zeilen Code inkl. Deklaration, Funktion und Funktionsaufruf in Schleife. Du hast dafür ca. 90 Zeilen benötigt.

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    GUICreate('Test', 1600, 1000)

    [/autoit] [autoit][/autoit] [autoit]

    Global $aLeftTopTitle[7][3] = [[100,190,"1. Objektivität / Fairness "],[100,420,"2. Kompetenz in seiner Aufgabe "],[100,640,"3. Verständnis für Anliegen/Probleme "], _
    [510,190,"4. Hilfsbereitschaft "],[510,420,"5. Loyalität "],[510,640,"6. Fähigkeit zum Vermitteln von Zusammenhängen "],[920,190,"7. Motivation "]]
    Global $aCtrlArray[7]
    For $i = 0 To 6
    $aCtrlArray[$i] = _Group_w_Radio($aLeftTopTitle[$i][2], $aLeftTopTitle[$i][0], $aLeftTopTitle[$i][1], 350, 200)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Until GUIGetMsg() = -3

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Group_w_Radio($_sTitle, $_iX, $_iY, $_iW, $_iH)
    Local $aCtrl[8] ; == 6*Radio, 1*Picture, 1*Edit
    Local $iW_radio = 40 ; == HIER kannst du variieren im Abstand der Radios
    GUICtrlCreateGroup($_sTitle, $_iX, $_iY, $_iW, $_iH)
    GUICtrlSetFont(-1, 10, 120, 0, "Arial")
    For $i = 0 To 5 ; == Radio erstellen
    $iStyle = Default
    If $i = 0 Then $iStyle = $WS_GROUP
    $aCtrl[$i] = GUICtrlCreateRadio( $i+1, $_iX +20 +$i*$iW_radio, $_iY +30, $iW_radio, 20, $iStyle)
    Next
    $aCtrl[6] = GUICtrlCreatePic("", $_iX +20 +200, $_iY +25, 44, 44)
    $aCtrl[7] = GUICtrlCreateEdit("", $_iX +20, $_iY +70, $_iW -40, $_iH -80)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Return $aCtrl
    EndFunc

    [/autoit]

    Edit:

    Ich habe den Code jetzt mal etwas überarbeitet und die Smiley-Aktivierung eingefügt:

    Spoiler anzeigen
    [autoit]

    #include <WindowsConstants.au3>
    GUICreate('Test', 1600, 1000)

    [/autoit] [autoit][/autoit] [autoit]

    Global $sPathIcon = "C:\Users\BugFix\Pictures\SMILEYS" ; == Smileys im Anhang, Pfad anpassen.

    [/autoit] [autoit][/autoit] [autoit]

    Global $aPict[6] = [ _
    $sPathIcon & "1.ico", _
    $sPathIcon & "2.ico", _
    $sPathIcon & "3.ico", _
    $sPathIcon & "4.ico", _
    $sPathIcon & "5.ico", _
    $sPathIcon & "6.ico"]

    [/autoit] [autoit][/autoit] [autoit]

    Global $aLeftTopTitle[7][3] = [[100,190,"1. Objektivität / Fairness "],[100,420,"2. Kompetenz in seiner Aufgabe "],[100,640,"3. Verständnis für Anliegen/Probleme "], _
    [510,190,"4. Hilfsbereitschaft "],[510,420,"5. Loyalität "],[510,640,"6. Fähigkeit zum Vermitteln von Zusammenhängen "],[920,190,"7. Motivation "]]
    Global $aCtrlArray[7]
    For $i = 0 To 6
    $aCtrlArray[$i] = _Group_w_Radio($aLeftTopTitle[$i][2], $aLeftTopTitle[$i][0], $aLeftTopTitle[$i][1], 350, 200)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    If $nMsg = -3 Then Exit
    For $i = 0 To 6
    $aTmpCtrl = $aCtrlArray[$i]
    For $j = 0 To 5
    If $nMsg = $aTmpCtrl[$j] Then
    GUICtrlSetImage($aTmpCtrl[6], $aPict[$j])
    ExitLoop(2)
    EndIf
    Next
    Next
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Group_w_Radio($_sTitle, $_iX, $_iY, $_iW, $_iH)
    Local $aCtrl[8] ; == 6*Radio, 1*Icon, 1*Edit
    Local $iW_radio = 40 ; == HIER kannst du variieren im Abstand der Radios
    GUICtrlCreateGroup($_sTitle, $_iX, $_iY, $_iW, $_iH)
    GUICtrlSetFont(-1, 10, 120, 0, "Arial")
    For $i = 0 To 5 ; == Radio erstellen
    $iStyle = Default
    If $i = 0 Then $iStyle = $WS_GROUP
    $aCtrl[$i] = GUICtrlCreateRadio( $i+1, $_iX +20 +$i*$iW_radio, $_iY +30, $iW_radio, 20, $iStyle)
    Next
    $aCtrl[6] = GUICtrlCreateIcon("", -1, $_iX +$_iW -60, $_iY +20, 40, 40)
    $aCtrl[7] = GUICtrlCreateEdit("", $_iX +20, $_iY +70, $_iW -40, $_iH -80)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Return $aCtrl
    EndFunc

    [/autoit]

    So sieht das dann aus:
    autoit.de/wcf/attachment/23718/

  • Hallo Bugfix,

    das dachte ich mir schon, dass dies einfacher geht!

    Danke für deine Unterstützung :) Werd mir das mal ansehen und entsprechend umsetzen ...

    Hab da noch ne Frage ... Wenn ich jetzt weitere Groups hinzufügen möchte, die aber nur eine EditBox haben, müsste ich doch den Bereich "$aLeftTopTitle[7][3]" erweitern und dann keine Radios erzeugen oder?


    Gruß gmmg

  • BugFix ,

    ich habe jetzt das Array wie folgt $aLeftTopTitle[9][4] erweitert, um zwei weitere Editboxen hinzuzufügen ....

    [autoit]


    Global $aLeftTopTitle[9][4] = [[80,190,"1. Objektivität / Fairness ", 1],[80,420,"2. Kompetenz in seiner Aufgabe ",1],[80,640,"3. Verständnis für Anliegen/Probleme ",1], _
    [465,190,"4. Hilfsbereitschaft ",1],[465,420,"5. Loyalität ",1],[465,640,"6. Fähigkeit zum Vermitteln von Zusammenhängen ",1], _
    [850,190,"7. Motivation ",1],[850,420,"8. test 8 ohne Radio",0], [850,640,"9. test 9 ohne Radio",0]]
    Global $aCtrlArray[9]

    [/autoit][autoit][/autoit][autoit]

    For $i = 0 To 8
    $aCtrlArray[$i] = _Group_w_Radio($aLeftTopTitle[$i][2], $aLeftTopTitle[$i][0], $aLeftTopTitle[$i][1], $aLeftTopTitle[$i][3], 350, 200)
    Next

    [/autoit]


    1 = Radio Button vorhanden
    0 = ohne Radio Button

    dann in der Func _Group_w_Radio($_sTitle, $_iX, $_iY, $radio_yes, $_iW, $_iH) den wert "$radio_yes" erweitert ..

    siehe schript ...

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    GUICreate("... Feedback Tool ...",@DesktopWidth,@DesktopHeight,0,0, $WS_OVERLAPPEDWINDOW)

    [/autoit] [autoit][/autoit] [autoit]

    Global $sPathIcon = @ScriptDir & "\SMILEYS" ; == Smileys im Anhang, Pfad anpassen.

    [/autoit] [autoit][/autoit] [autoit]

    Global $aPict[6] = [ _
    $sPathIcon & "1.ico", _
    $sPathIcon & "2.ico", _
    $sPathIcon & "3.ico", _
    $sPathIcon & "4.ico", _
    $sPathIcon & "5.ico", _
    $sPathIcon & "6.ico"]

    [/autoit] [autoit][/autoit] [autoit]

    Global $aLeftTopTitle[9][4] = [[80,190,"1. Objektivität / Fairness ", 1],[80,420,"2. Kompetenz in seiner Aufgabe ",1],[80,640,"3. Verständnis für Anliegen/Probleme ",1], _
    [465,190,"4. Hilfsbereitschaft ",1],[465,420,"5. Loyalität ",1],[465,640,"6. Fähigkeit zum Vermitteln von Zusammenhängen ",1], _
    [850,190,"7. Motivation ",1],[850,420,"8. test 8 ohne Radio",0], [850,640,"9. test 9 ohne Radio",0]]
    Global $aCtrlArray[9]

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To 8
    $aCtrlArray[$i] = _Group_w_Radio($aLeftTopTitle[$i][2], $aLeftTopTitle[$i][0], $aLeftTopTitle[$i][1], $aLeftTopTitle[$i][3], 350, 200)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $Button_Absenden = GUICtrlCreateButton( "Formular Absenden",@DesktopWidth * (50 /100) -50,900,130,30, 0x0C00 )

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    If $nMsg = -3 Then Exit
    For $i = 0 To 8
    $aTmpCtrl = $aCtrlArray[$i]
    For $j = 0 To 5
    If $nMsg = $aTmpCtrl[$j] Then
    GUICtrlSetImage($aTmpCtrl[6], $aPict[$j])
    ExitLoop(2)
    EndIf
    Next
    Next
    Switch $nMsg
    Case $Button_Absenden
    MsgBox(0, "", "First Case expression was true")
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Group_w_Radio($_sTitle, $_iX, $_iY, $r_yes_now, $_iW, $_iH)
    Local $aCtrl[8] ; == 6*Radio, 1*Icon, 1*Edit
    Local $iW_radio = 40 ; == HIER kannst du variieren im Abstand der Radios
    GUICtrlCreateGroup($_sTitle, $_iX, $_iY, $_iW, $_iH)
    GUICtrlSetFont(-1, 10, 120, 0, "Arial")
    For $i = 0 To 5 ; == Radio erstellen
    $iStyle = Default
    If $i = 0 Then $iStyle = $WS_GROUP
    If $r_yes_now = 1 then $aCtrl[$i] = GUICtrlCreateRadio( $i+1, $_iX +20 +$i*$iW_radio, $_iY +30, $iW_radio, 20, $iStyle)
    Next
    If $r_yes_now = 1 then $aCtrl[6] = GUICtrlCreateIcon("", -1, $_iX +$_iW -60, $_iY +20, 40, 40)
    $aCtrl[7] = GUICtrlCreateEdit("", $_iX +20, $_iY +70, $_iW -40, $_iH -80)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    Return $aCtrl
    EndFunc

    [/autoit]

    kannst du mal bitte drüber schauen, ob dass so passt?
    nun müsste ja genauso abgefragt werden, dass alle elemente einer Group ausgefüllt sind! also Radio Button geklickt und Edit ausgefüllt!

    Danke
    gruß gmmg

    2 Mal editiert, zuletzt von gmmg (27. November 2013 um 17:03)