Solved

Hide TRadioGroup or TGroupBox frame?

Posted on 2004-09-29
6
2,173 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now