Solved

Hide TRadioGroup or TGroupBox frame?

Posted on 2004-09-29
6
2,300 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
[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
  • 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
Industry Leaders: 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!

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Title # Comments Views Activity
Delphi 2 77
can't find the executable in Simulator 1 112
IdTCPClient and IdTCPServer exchanging data on desktops and not Android 11 166
scroll down TListBox component in Delphi 1 31
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 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