Creates a Radio button control for the GUI.
GUICtrlCreateRadio ( "text", left, top [, width [, height [, style [, exStyle]]]] )
Parameters
text | The text of the control. |
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode. |
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode. |
width | [optional] The width of the control (default is the previously used width). |
height | [optional] The height of the control (default is the previously used height). |
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default ( -1) : none. forced styles : $BS_AUTORADIOBUTTON and $WS_TABSTOP if first radio in the group. |
exStyle | [optional] Defines the extended style of the control. See Extended Style Table. |
Return Value
Success: | Returns the identifier (controlID) of the new control. |
Failure: | Returns 0. |
Remarks
To obtain the value of the control see GUICtrlRead.
Related
GUICoordMode (Option), GUICtrlSet..., GUIGetMsg
Example
#include <GUIConstants.au3>
GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered
$radio1 = GUICtrlCreateRadio ("Radio 1", 10, 10, 120, 20)
GUICtrlSetState ($radio1,$GUI_CHECKED)
$radio2 = GUICtrlCreateRadio ("Radio 2", 10, 40, 120, 20)
GUISetState () ; will display an dialog box with 1 checkbox
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend