From Xojo Documentation

Class (inherits from WebUIControl)

Allows you to add a set of radio buttons to a web page. You can group the buttons in any number of columns and rows.

Closed Hidden Shown
ContextualMenuSelected Opening ValueChanged
ContextualMenu LockBottom fa-lock-32.png SelectedRowIndex
ControlID fa-lock-32.png LockHorizontal fa-lock-32.png Style
Enabled LockLeft fa-lock-32.png TabIndex
Height LockRight fa-lock-32.png Tooltip
Horizontal LockVertical fa-lock-32.png Top
Indicator Name fa-lock-32.png Visible
InitialValue fa-lock-32.png Page fa-lock-32.png Width
Left Parent fa-lock-32.png
AddRow GotoURL SelectedRow
AddRowAt RemoveAllRows SetFocus
Close RemoveRowAt UpdateBrowser
ExecuteJavaScript RowAt


By default, the WebRadioGroup control creates a group with two rows and one column, but this is easily changed via the Horizontal and InitialValue properties in the Inspector.

To determine which radiobutton was pressed, use the ValueChanged event.

The SelectedRowIndex property and SelectedRowValue method can be used to identify which WebRadioButton was selected.

You can access the individual buttons using the RowAt method and SelectedRowIndex property.

Sample Code

This code selects a radio button, which has the effect of de-selecting all the other radio buttons in the group:

RadioGroup1.SelectedRowIndex = 1

Use SelectedRowIndex in the ValueChanged event handler to determine which radio button was pressed.

For example, the following code in the ValueChanged event handler will display a message based upon which radio button is pressed:

Select Case Me.SelectedRowIndex
Case 0 // Row 1
MessageBox("You clicked the top button.")
Case 1 // Row 2
MessageBox("You clicked the bottom button.")
End Select

See Also

WebCheckBox, WebPopupMenu controls; RadioButton desktop control