I have total 4 radiobuttons on my form,I want to set the first two buttons in one group and the second two in another group so that I can check one from the first group and one from the second group.
Right now,if I check one from the first group,the one from the second group becomes unchecked.
I've always wondered how to do this and I believe now's the time to figure this out. :)
Under Insert controls, click Option Button. In the Insert Option Buttons dialog box, enter the number of buttons that you want to insert, and then click OK.
You group radio buttons by drawing them inside a container such as a Panel control, a GroupBox control, or a form. All radio buttons that are added directly to a form become one group. To add separate groups, you must place them inside panels or group boxes.
Once the radio group is created, selecting any radio button in that group automatically deselects any other selected radio button in the same group. You can have as many radio groups on a page as you want, as long as each group has its own name.
To quote from the trusted Delphi 5 help:
By default, all radio buttons that are directly contained in the same windowed control container, such as a
TRadioGroup
orTPanel
, are grouped. For example, two radio buttons on a form can be checked at the same time only if they are contained in separate containers, such as two different group boxes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With