S Steve-h Member Oct 21, 2021 #1 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
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
B Brian Dean Well-Known Member Licensed User Longtime User Oct 22, 2021 #2 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 RadioButtons.zip 9.2 KB · Views: 768 Upvote 1
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.
S Steve-h Member Oct 22, 2021 #3 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
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.
M Mahares Expert Licensed User Longtime User Oct 23, 2021 #4 Steve-h said: I can see they should be contained within a panel Click to expand... Steve-h said: I have learnt how to tie the buttons to the panel Click to expand... The radio buttons do not have to be necessarily on the same panel. As long as they have the same event name, they are still mutually exclusive, which means when one is checked the others are unchecked. Upvote 0
Steve-h said: I can see they should be contained within a panel Click to expand... Steve-h said: I have learnt how to tie the buttons to the panel Click to expand... The radio buttons do not have to be necessarily on the same panel. As long as they have the same event name, they are still mutually exclusive, which means when one is checked the others are unchecked.
B Brian Dean Well-Known Member Licensed User Longtime User Oct 23, 2021 #5 As long as they have the same event name, they are still mutually exclusive Click to expand... 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: Nov 11, 2021 Upvote 0
As long as they have the same event name, they are still mutually exclusive Click to expand... 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.]