Radio Button Controls
The following lists the mandatory properties for radio button controls.
Radiobutton control-id"title"x y width height
Property |
Description |
radiobutton |
Identifies the control as a radio button control. |
control-id |
Control ID number. It must be an integer between 1 and 32767 and be unique within a given top-level window. |
"title" |
Title of the control, contained in quotation marks. |
x |
Horizontal position of the upper-left corner of the control in current units. |
y |
Vertical position of the upper-left corner of the control in current units. |
width |
Width of the control in current units. |
height |
Height of the control in current units. |
The Resource Properties Index identifies and describes the optional properties for this control.
Backgroundcolor
Checked
Clientedge
Disabled
Font
Foregroundcolor
Group
Initialcontents
Invisible
Justification
Longcue
Name
Opaque
Popupmenuid
Raisededge
Shortcue
Textleft
Title
Example
The following example contains a window with two radio button controls; the first contains only the mandatory definitions, and the second contains optional settings.
Version "3.0"
Window 1 "Control Window" 0 0 200 100
Begin
Radiogroup 1, 2
Radiobutton 1 "OK" 10 10 50 25
Radiobutton 2 "Done" 50 10 50 25 Begin
Backgroundcolor Rgb(128,255,128)
Foregroundcolor Rgb(64,128,64)
Font "Arial" 12, Bold, CS_DEFAULT
Group Checked Clientedge Raisededge
Justification JUSTIFICATION_LEFT
End
End
Radiogroup Option
The radio button control has an optional setting that can be used to group buttons within a window definition. A radio button can only be a member of one radiogroup. All radio buttons that are not part of a specific radio group are considered to be in a group by themselves. The following lists the radiogroup option syntax:
radiogroup control_id, control_id.
Radiogroup Option Example
The following example defines a window that contains six radio buttons. Radio buttons 1 and 2 are contained in one radiogroup, while radio buttons 5, 6, 7, and 8 are contained in another radiogroup:
Version "3.0"
Window 1 "First Window" 0 0 200 100 Begin
Radiogroup 1, 2
Radiobutton 1 "OK" 10 10 50 25
Radiobutton 2 "Done" 50 10 50 25
Button 3 "OK" 10 10 50 25
Checkbox 4 "Done" 10 10 50 25
Radiobutton 5 "OK" 10 10 50 25
Radiobutton 6 "Done" 50 10 50 25
Radiobutton 7 "OK" 10 10 50 25
Radiobutton 8 "Done" 50 10 50 25
Radiogroup 5,6,7,8
End