From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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 SelectedIndex
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
Add ExecuteJavaScript RemoveAt
AddAt GotoURL SelectedItem
Close ItemAt SetFocus
Count RemoveAll UpdateBrowser


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 SelectedIndex property and SelectedItem method can be used to identify which WebRadioButton was selected.

You can access the individual buttons using the ItemAt method and SelectedIndex 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.SelectedIndex = 1

Use SelectedIndex 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.SelectedIndex
Case 0 // Row 1
MessageBox("You clicked the top button.")
Case 1 // Row 2
MessageBox("You clicked the bottom button.")
End Select

See Also

WebRadioButton class; WebCheckBox, WebPopupMenu controls