In the action event for the radio buttons, just for now, I am asking it to print out the radiobutton1.index, and it throws this massive number : -21799xxx
Under the radiobutton Action event, if I use Groupbox1.index I get the same thing
Radiobuttons that are in a group box (or similar parent) act as a group. Implement the action event in each RadioButton and just use this code:
Msgbox "This is radioButton <X>"
Dave’s reply was assuming your were creating Control Set (sometimes called a Control Array). In that case the index (of the control group) would be passed in via the Action event.
But if you are unfammiliar with the concept of Control Arrays, …
@Michael Cebasek you can add a RadioButton, give it a Name. Then add another RadioButton and give it the same Name, Xojo will ask if you want to create a Controll Array. Now you can Add more RadioButtons with the same Name and they will be added to your Control Array also.
Now you have to deal with one Action Event for all Controls in the same Control Array. In this Action Event you have an index Property which tells you which Control in this Array has been used. Now @Dave S 's example will work.
radio buttons depend on their parenting to know which ones should act as a group of related radio buttons
in a related set when you click one to enable it the others will disable
and this has nothing to do with them being a control set
if you have a control set of two radio buttons and a single radio button that is not part of the control set on a window all three behave as a single group of radio buttons
click any one and the others will disable
to make it so they act as independent groups you need to parent the ones you want to act as one set in a canvas or other control and the rest in something else
and you could split a control set across those containers