Solved

TRadiobutton and Groupbox

Posted on 1998-09-17
3
574 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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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