?
Solved

TRadiobutton and Groupbox

Posted on 1998-09-17
3
Medium Priority
?
576 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1340063
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 150 total points
ID: 1340064
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
ID: 1340065
thanks victor!
regards titz
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

762 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