Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio groups working independently?

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi

I've got 2 Radio groups (both with 2 radio buttons in each) on one form. I can't stop one group unchecking a radio btn when I click on one radio btn in the other radio group.

How do I get them working independently so I can have one radio btn checked in each group?

lou
 
It's okay, I'm using TGroupBox instead now - they work. How are Radio Group boxes used then?
 
Were you adding radiobuttons to the groupbox using the Items property?
 
erm, no - was using Radio btn from the toolbar. Haven't used the component before.

Once I've added them using the Items property, do you have any control over the spacing of them?

lou
 
It's possible if you have created a first radio group, added items to it and then copy/pasted it with all assigned event handlers.

--- markus
 
Yes try the columns property and the adjusting of length and width Steven van Els
SAvanEls@cq-link.sr
 
Quoth the help:
By default, all radio buttons that are directly contained in the same windowed control container, such as a TRadioGroup or TPanel, are grouped.

So you can continue to use TRadioButton, if you want, provided that each group is parented in a separate control. OTOH, if TGroupBox is flexible enough for you, you should use it, 'cos it's a bit easier and looks a bit standard-er.

There's a similar screw-up I sometimes encounter when setting up radio groups in menus: GroupIndex is non-decreasing within the one menu, so when you drag stuff around within your menu, the IDE silently resets your GroupIndexes, and then you get the same thing Weez had, where checking stuff unchecks other stuff in a way you didn't intend. -- Doug Burbidge mailto:dougburbidge@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top