Web Radio Group
From Xojo Documentation
Contents
A Radio Group control provides a collection of radio buttons for the user to choose from. It enables you to create a single control that contains a row by column array of radio buttons. The default for a Radio Group is one column and two rows.
In a Web Radio Group control, the number of rows and columns is controlled by the ColumnCount and RowCount properties in the Inspector. Change these properties as necessary and then resize the control so that everything fits properly.
To edit the cells of a Radio Group, use the Set Default Value feature. Once active, you can click on each cell to set its properties (Caption, Enabled, Visible, Tag and Selected).
Below are commonly used events, properties and methods. Refer to WebRadioGroup in the Language Reference for the complete list.
Events
- Called when the radio button selection has changed.
Properties
- Use to set the caption for a specific radio button (cell). Supply the row and column as parameters.
- Use to enable or disable a specific radio button (cell).
- Use to select or deselect a specific radio button (cell).
- Use to get or set the tag value for a specific radio button (cell).
- Use to get or set the visibility of a specific radio button (cell).
- The number of columns in the radio group.
- The number of rows in the radio group.
Methods
- Allows you to select a specific radio button in the Radio Group by specifying its Caption or Tag value.
- Returns the Caption of the selected radio button.
- Returns the row and column indexes of the selected radio button as a Pair.
- Returns the Tag of the selected radio button.
Usage
When you drag a Radio Group control onto a layout, it starts with one column and two rows called "First" and "Second". You can use this code in the SelectionChanged event to determine which radio button is selected by the user:
p = Me.SelectedCell
Select Case p.Left
Case 0 // Row 1
MsgBox("You clicked the top button.")
Case 1 // Row 2
MsgBox("You clicked the bottom button.")
End Select
See Also
WebRadioGroup class; UserGuide:Web UI topic