tags:

views:

428

answers:

2

Hello,

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. :)

+6  A: 

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 or TPanel, 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.

mghie
Agreed. Radiobutton grouping is based on Parent/Child relationships. In order to have multiple groups of buttons, you must use multiple Parent controls.
Remy Lebeau - TeamB
A: 

Put two buttons on a panel, and the other two on another panel. That way, they will be treated as separate groupings. Change the panel bevels to remove the edge, and the four buttons won't look to the user as if they are separated, if that's what you'd like.

Kevin Killion