Solved

Hide TRadioGroup or TGroupBox frame?

Posted on 2004-09-29
6
2,265 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

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 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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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