Android Question B4A Radio Buttons

Steve-h

Member
Please could someone point me towards a beginner's guide to using radio buttons. I can see they should be contained within a panel but have not figured out how to link them together or make them visible.

Thanks
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
If you put several radio buttons into the same panel so that the panel is the parent of all of them then the buttons will look after themselves; only one button will be checked at a time.

An easy way to handle them is to give them different Tag valued but have them all share the same handler.

Here is an example. There are a lot of other options, but this should get you going.
 

Attachments

  • RadioButtons.zip
    9.2 KB · Views: 414
Upvote 1

Steve-h

Member
That simple example was enormously helpful, thank you.

I have learnt how to tie the buttons to the panel and a use for Tag. Both of which are obvious for someone who already knows but not obvious to a beginner reading the documentation.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
As long as they have the same event name, they are still mutually exclusive
Well, I never knew that, and I have been using B4A for seven years.

[Edit : And now that I have tested this out, I am not sure that it is true.]
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…