Erstellt ein Radiobutton für die GUI.
GUICtrlCreateRadio ( "text", left, top [, width [, height [, style [, exStyle]]]] )
| text | Die Beschriftung des Radiobutton. |
| left | Die linke Seite des Controls. Wird -1 verwendet, dann wird left mit Hilfe von GUICoordMode berechnet. |
| top | Die Oberkante des Controls. Wird -1 verwendet, dann wird top mit Hilfe von GUICoordMode berechnet. |
| width | [optional] Die Breite des Controls (Standard: Länge des Textes). |
| height | [optional] Die Höhe des Controls (Standard: Höhe des Textes). |
| style | [optional] Legt den Stil des Controls fest. Siehe Anhang GUI-Stile für Controls. Standard ( -1) : Keine. Erzwungene Stile : $BS_AUTORADIOBUTTON und $WS_TABSTOP wenn dies das erste Radiobutton in einer Gruppe ist. |
| exStyle | [optional] Legt den erweiterten Stil des Controls fest. Siehe Tabelle der erweiterten Stile. |
| Erfolg: | Gibt die Identifikationsnummer (Control-ID) des neuen Controls zurück. |
| Fehler: | Gibt 0 zurück. |
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $radio1, $radio2, $msg
GUICreate("Meine GUI mit Radiobuttons") ; Erstellt ein GUI-Fenster welches mittig ausgerichtet wird
$radio1 = GUICtrlCreateRadio("Radiobutton 1", 10, 10, 120, 20)
$radio2 = GUICtrlCreateRadio("Radiobutton 2", 10, 40, 120, 20)
GUICtrlSetState($radio2, $GUI_CHECKED)
GUISetState() ; Zeigt das GUI-Fenster mit 2 Radiobuttons
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
MsgBox(64, 'Info:', 'Es wurde Radiobutton 1 angeklickt und ausgewählt')
Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
MsgBox(64, 'Info:', 'Es wurde Radiobutton 2 angeklickt und ausgewählt')
EndSelect
WEnd
EndFunc ;==>Example