### Create RadioButtonGroup

to be able to group Radio Buttons, the solution is via code:
Define the RadioButtons
`Sub Process_Globals
...
Private RadioButton1 As RadioButton
Private RadioButton2 As RadioButton
Private RadioButton3 As RadioButton
...
End Sub`
Important:
The RadioButtons have all the same event name set: RadioButton which is then used by the RadioButton_SelectedChange event.
Build the Group - requires only RadioButton one to do so
RadioButton1.GroupRadioButtons(Array(RadioButton1, RadioButton2, RadioButton3))
The RadioButtons are stored in a List.
Instead of using an Array, a List can also be build like:
Private RadioButton(3) As RadioButton
Private RadioButtonList As List
'Create a list of radiobuttons
RadioButtonList.Initialize
For n = 0 To 2
RadioButton(n).Initialize("RadioButton")
RadioButton(n).Text = "RadioButton " & n
MainForm.RootPane.AddNode(RadioButton(n), 50, 50*(n + 1), 200, 50)
RadioButtonList.Add(RadioButton(n))
Next
'Add the list to the first RadioButton in the list.
RadioButton(0).GroupRadioButtons(RadioButtonList)
Handle change of the selected RadioButton
`Sub RadioButton_SelectedChange(Selected As Boolean)
Dim rb As RadioButton
rb = Sender
If rb.Selected Then Log($"RadioButton selected: ${rb.Text}"$)
End Sub`
Checks if a radiobutton is selected.
'The radiobuttons are defined in the rootpane of a form
`Sub CheckRadioButtonSelected(frm As Form)
For Each n As Node In frm.RootPane.GetAllViewsRecursive
If n Is RadioButton Then
Dim rb As RadioButton = n
If rb.Selected Then
fx.Msgbox(MainForm, $"The RadioButton selected is ${rb.Text}"$, "Check RadioButton Selected")
Exit
End If
End If
Next
fx.Msgbox(MainForm, $"There is no RadioButton selected."$, "Check RadioButton Selected")
End Sub`

Changed: , Category: RadioButtons, File: T6C233M1704.htm, ID: 1704