Solved

TRadiobutton and Groupbox

Posted on 1998-09-17
3
568 Views
Last Modified: 2008-03-10
Hi,
under D3 (and WIN98) i create at runtime (!) four different groupboxes (not overlapping) and in each groupbox there are three radiobuttons.
Everytime i click at one radiobutton, it will be checked, but all (!) other radiobuttons turn to "not checked", not only those of the same group.
what is my mistake ??
how can i tell a radiobutton to which group he does belong ?

when i did the same in the D3-Designer, it works correct.

hope for help !
titz
0
Comment
Question by:titz
3 Comments
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
titz,

are you using only the component TRadioGroup or are you grouping TRadioButtons together by yourself?
In both cases make sure that you set the parent property to the right value (probably the form or a panel).
In the second case put all radioButtons that belong to one group on one group panel. So for 4 different groupBoxes you'll have to create 4 panels.
In the first case make sure, you set the "name" property to a senseful setting. If it still doesn't work there's a little trick to find out what you've to do. Create in the designer exactly the situation you want to have. Then right click on the form and select "view as text" (I don't know if that's the name of the menu item I mean; I've the german version). Now look what properties the designer has set and do the same during runtime.
If you still have problems, please post some sources.

Hope this helps... Madshi.
0
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
Comment Utility
When you create the radio buttons you need to set the parent.....Here is how....

If you create controls at design time...

YOu need to select the groupbox, and then drop the radio buttons on the groupbox....

if you create the controls at runtime here is how to set the parents.....

var
  i: integer;
  RBtn : TRadioButton;
begin
  for i := 0 to 2 do
  begin
    RBtn := TRadioButton.Create(self);
    RBtn.Parent := MyGroupBox1;
    //Other properties and events
  end;
end;

Regards,
Viktor Ivanov
0
 
LVL 1

Author Comment

by:titz
Comment Utility
thanks victor!
regards titz
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now