UserGuide

Difference between revisions of "Web Radio Group"

From Xojo Documentation

 
Line 12: Line 12:
  
 
== Events ==
 
== Events ==
[[WebRadioGroup.ValueChanged|ValueChanged]]
+
[[WebRadioGroup.ValueChanged|ValueChanged]] - Called when the selected radio button has changed.
:Called when the selected radio button has changed.
 
  
 
== Properties ==
 
== Properties ==
[[WebRadioGroup.SelectedRowIndex|SelectedRowIndex]]
+
[[WebRadioGroup.SelectedRowIndex|SelectedRowIndex]] - Use to select or deselect a specific radio button (cell).
:Use to select or deselect a specific radio button (cell).
 
  
 
== Methods ==
 
== Methods ==
[[WebRadioGroup.RowAt|RowAt]]
+
[[WebRadioGroup.RowAt|RowAt]] - Returns the [[WebRadioButton]] at the index passed.
:Returns the [[WebRadioButton]] at the index passed.
 
  
[[WebRadioGroup.SelectedRow|SelectedRow]]
+
[[WebRadioGroup.SelectedRow|SelectedRow]] - Returns the [[WebRadioButton]] selected.
:Returns the [[WebRadioButton]] selected.
 
  
 
== Usage ==
 
== Usage ==
Line 34: Line 30:
 
Case 1 // Row 2
 
Case 1 // Row 2
 
   MessageBox("You clicked the bottom button.")
 
   MessageBox("You clicked the bottom button.")
End Select</rbcode>
+
End Select
 +
</rbcode>
  
 
== See Also ==
 
== See Also ==
[[WebRadioGroup]] class; [[UserGuide:Web UI]] topic
+
[[WebRadioGroup]] class
  
 
[[Category:User Guide]]
 
[[Category:User Guide]]

Latest revision as of 19:01, 15 February 2021

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 an array of radio buttons. The default for a Radio Group is two rows/buttons.

In a Web Radio Group control, the number of rows/buttons is controlled by the Initial Value property in the Inspector.

To edit the cells of a Radio Group, use the Initial Values property in the Inspector.

A WebRadioGroup is made up of several WebRadioButtons. Many properties and methods return a WebRadioButton and thus you will want to look at that class for information now what you do with individual radio buttons in the group.

Below are commonly used events, properties and methods. Refer to WebRadioGroup in the Language Reference for the complete list.

Events

ValueChanged - Called when the selected radio button has changed.

Properties

SelectedRowIndex - Use to select or deselect a specific radio button (cell).

Methods

RowAt - Returns the WebRadioButton at the index passed.

SelectedRow - Returns the WebRadioButton selected.

Usage

When you drag a Radio Group control onto a layout, it starts with two rows called "Option 1" and "Option 2". You can use this code in the ValueChanged event to determine which radio button is selected by the user:

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

WebRadioGroup class