RadioButton - GroupName

P

Phil Jones

I'm adding two sets of radio-buttons to a control (ie. each set of buttons
should only have one selection).

The problem is all the radio buttons within the form think they are part of
the same group (only one button can be selected from all groups).

With WebControls I would have used the "GroupName" property to setup the
unique groups.

But I can't find the corresponding property for the WinForms RadioButton.

What should I do here. Thanks everyone!
==
Phil
 
T

Tim Wilson

Place each group of RadioButtons in a separate Panel. They will be grouped
by container.
 
O

Otis Mukinfus

I'm adding two sets of radio-buttons to a control (ie. each set of buttons
should only have one selection).

The problem is all the radio buttons within the form think they are part of
the same group (only one button can be selected from all groups).

With WebControls I would have used the "GroupName" property to setup the
unique groups.

But I can't find the corresponding property for the WinForms RadioButton.

What should I do here. Thanks everyone!
==
Phil

Phil,

On a Windows form there are two ways I have investigated:

1. (The most comman method) First add a GroupBox control to the form,
then select it. Double click thr adio buttons in the Toolbox. The
radio buttons you place in the GroupBox container will only allow one
button to be set true at a time. However, unlike the RadioButtonList
you are used to using, the GroupBox control is visible. If you don't
want the frame visible see #2

2. Place the the radio buttons in a Panel control, which is invisible.

Both of these controls along with several other container controls are
foundin the tool box's container group.

Comment: It is typical to use the GroupBox control, because you can
use the Text property of the control to describe the grouping of the
controls.
Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
P

Phil Jones

Rats! I was fearing that.

I've been creating a whole framework that uses GDI+ to custom paint things
so I can overlay controls without square borders. Using a panel kinda-kills
that.

Thanks for the answer - I'll no doubt figure a way around this.

Cheers!
===
Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top