DesktopRadioGroup
From Xojo Documentation
Class (inherits from DesktopUIControl)
New in 2021r3
Displays a group of radio buttons.
Properties | |||||||||||||||||||||||||||||||||
|
Methods | |||||||||||||||
|
Notes
Sample Code
This code in the Opening event handler populates a radio group and sets the initial value to the current month:
Var months() As String = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
For Each m As String In months
Var rb As New DesktopRadioButton(m)
Me.Add(rb)
Next
Var d As New DateTime
Me.SelectedIndex = d.Month - 1 // Select current month
For Each m As String In months
Var rb As New DesktopRadioButton(m)
Me.Add(rb)
Next
Var d As New DateTime
Me.SelectedIndex = d.Month - 1 // Select current month
Examine the value of SelectedIndex in the SelectionChanged event handler to determine which item was selected.
This code adds an item to PopupMenu:
RadioGroup1.Add(new DesktopRadioButton("October"))
This code populates the RowTag identifier with a sequence number:
Since Tag is a Variant, you must first convert it to an Integer if you want to compare it to another integer. Do this with a simple assignment statement such as:
Then compare recID to another Integer.
Changing the selected item in a RadioGroup:
RadioGroup1.SelectedIndex = 3 // Selects the 4th radio button in the group
Displaying the RowTag of the selected menu item:
TexField1.Value = RadioGroup1.ItemAt(RadioGroup1.SelectedIndex).Tag
See Also
DesktopRadioButton control; DesktopUIControl class.