RectControl → Control → Object

RadioButton Class

The standard radio button control. If you enclose a group of radio button controls within a parent control (or just the parent window), REALbasic will automatically deselect the remaining radio buttons when the user clicks a radio button in the group.

Events
Action
GotFocus
LostFocus
MouseDown
MouseUp

Properties
Bold
Caption
Italic
TextFont
TextSize
Underline
Value

# Notes

Because this is a RectControl, see the RectControl for other properties and events that are common to all RectControl objects.

If you have more than one group of radio buttons in a window, each group should have its own parent control. Radiobuttons within a group will be enabled and disabled automatically as the user clicks on a radiobutton within a group. You can use controls such as GroupBoxes, TabPanels, PagePanels, or even Canvases as parent controls.

If the Caption property contains an ampersand character, it will display only if it is preceded by another ampersand character. This is done to make applications on all platforms behave consistently.

# Example

The three RadioButtons are set up as a control array. That is, each RadioButton is named "RadioButton1" and their Index properties are set to 0, 1, and 2, respectively.

RadioButton1's Action event is passed the parameter, Index as Integer. The parameter Index contains the value of Index for the RadioButton that was clicked. Use a Select Case statement to determine which button was clicked

Sub Action (Index as Integer)
Select Case index
Case 0
StaticText1.text="VHS"
Case 1
StaticText1.text="DV"
Case 2
StaticText1.Text="8 mm"
End Select

:

# See Also

GroupBox, PagePanel, TabPanel control; RectControl class.