Board index » delphi » programming a group of multiselectable RadioButtons

programming a group of multiselectable RadioButtons

I try to get 4 RadioButtons into a GroupBox, where 2 of them can be
activated (in one row).
Looks somehow like that.

[ ] button1   [ ] button2
[x] button3  [x] button 4

or

[x] button1  [x] button2
[ ] button3  [ ] button 4

I only can 1 of 4 activate instead of 2.....How do I do that? Help me
please....

R_F...@addcom.de

 

Re:programming a group of multiselectable RadioButtons


Is there any reason why you can't just put the items
into two GroupBoxes ?   Ie., one for each column ?
There does not have to be any visual indicator to the
user that they are in two separate groups - just put
them into panels instead of groups so that you don't
get stuck with the frames.

Alternatively, instead of taking a component that was
designed to have strictly one-item only selection,
try using TCheckBoxes and programatically enforcing
your rules about which multi-select combinations are
permissible.

Rob

Quote
Ronny Falk wrote:
> I try to get 4 RadioButtons into a GroupBox, where 2 of them can be
> activated (in one row).
> Looks somehow like that.

> [ ] button1   [ ] button2
> [x] button3  [x] button 4

> or

> [x] button1  [x] button2
> [ ] button3  [ ] button 4

> I only can 1 of 4 activate instead of 2.....How do I do that? Help me
> please....

> R_F...@addcom.de

Re:programming a group of multiselectable RadioButtons


On Sat, 14 Oct 2000 17:20:21 +0200, "Ronny Falk" <r_f...@addcom.de>
wrote:

Quote
>I try to get 4 RadioButtons into a GroupBox, where 2 of them can be
>activated (in one row).
>Looks somehow like that.

>[ ] button1   [ ] button2
>[x] button3  [x] button 4

>or

>[x] button1  [x] button2
>[ ] button3  [ ] button 4

>I only can 1 of 4 activate instead of 2.....How do I do that? Help me
>please....

The intent of radio buttons is to represent a set of mutually
exclusive options; so you can only have ONE radio button in a group
checked at a time.  If you need multiple arbitrary "checked" states
then you want checkboxes and not radiobuttons.

I'm a bit confused by your description.  Are you saying that if
button1 is checked then button2 is automatically also checked, and
vice versa (similarly with button3 and button4)?  

If that's the case then I'm unclear why you need four buttons, just
have two: one that represents the state of both button1 AND button2
being checked; the other representing the state of both button3 and
button4 checked.

Let's make a specific case that may help clarify the situation; right
now you have something like this:

  [ ] thin  [ ] crispy
  [ ] thick [ ] chunky

And you're saying that thin always goes with crispy; whereas thick
always goes with chunky (i.e. you never have "thin and chunky" or
"thick and crispy"), right?

In that case I'm saying you should use

  [ ] thin and crispy
  [ ] thick and chunky

If that's not what you mean then I need more information on what you
do mean.

Stephen Posey
slpo...@concentric.net

Re:programming a group of multiselectable RadioButtons


In article <8s9tjo$5u...@riker.addcom.de>, "Ronny Falk" <r_f...@addcom.de>
writes:

Quote
>I try to get 4 RadioButtons into a GroupBox, where 2 of them can be
>activated (in one row).
>Looks somehow like that.

If you want to use a groupbox for appearance, but group radiobuttons
individually then place the paired radiobuttons on a panel and place the panel
(with the two radiobuttons on it) on the groupbox. If you don't want the panel
to show then set the BevelInner and BevelOuter properties to bvNone.

The selected radiobutton is always unique within the set of radiobuttons on its
parent.

OTOH grouping four radiobuttons like this (with two being selectable within the
group) might be confusing to a user, and showing the panels, or using
checkboxes (with programmed logic to select only one of each pair) might be
better.

Alan Lloyd
alangll...@aol.com

Other Threads