Solved

Hide TRadioGroup or TGroupBox frame?

Posted on 2004-09-29
6
2,239 Views
Last Modified: 2008-03-10
I am trying to group TRadioButtons together, but I do not want a frame/border around the groupings.

IOW, imagine 4 TRadioButtons on a form.  Of these 4, 2 belong to one group, and the remaining 2 belong to a second group.  But I do  not want borders/frames/bevels around any of the groupings.

Both the TRadioGroup and TGroupBox components have no way to turn off the border/frame/bevel.

I am using Delphi 3.

Any suggestions?
0
Comment
Question by:Monroe406
  • 4
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12180951
? just drop your radios on a form

for two set an equal groupindex (1 for example)
for the other two set another equal groupindex (2 for example)

thats all, just from head

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12181053
hmm sorry, a radio has no groupindex, so forget my comment
0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12181065
Like kretzschmar said, you can drop a panel on the form and add the radio butons to it.

Or

You can derive your own radio button group and override the paint method:

type
  tRBG=class(tRadioGroup)
  protected
    procedure Paint; Override;
  end;

procedure tRBG.Paint;
var
  R: TRect;
begin
  with Canvas do begin
    R := ClientRect;
    Brush.Color := Color;
    FillRect(R);
  end;
end;

You can either add the new component to a package, or just add it to the form at run time:

procedure TForm2.FormCreate(Sender: TObject);
begin
  with tRBG.Create(self) do begin
    Parent:=Self;
    Left:=10;
    Top:=40;
    Width:=200;
    Height:=100;
    Items.Add('One');
    Items.Add('Two');
  end;
end;
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 12181085
well, this should work,

drop two panels as container (bevels can adjusted there)
in each panel drop two radios

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12181112
??

>Like kretzschmar said, you can drop a panel on the form and add the radio butons to it.

are you telepathic, LRHGuy?

0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12181524
Telepathic? It might be a talent I didn't know I had!

I figured panels would work and figured that's what you meant.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 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