Solved

Component to make existing radio group box and radio button transparent

Posted on 2004-03-29
6
619 Views
Last Modified: 2008-02-01
Hi,

I'm new to dephi. I have search the net for the component but i couldn't install it.
Do you know where I could get a simple component just to change my existing radio button on the form to be transparent? I want the background colour of the text for the radio button and group box to be transparent.

I notice that if you are running windows XP style it automatically do it for you. do you know why?

Thanks
0
Comment
Question by:AgeOfWars
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10708551
Check out the free LMD Component set (has a TRadioGroup w/ transparent display)

http://www.ceberus.com/lmd/mfs/products/LMD70.php3

TLMDRadioGroup
Improved replacement of TRadioGroup. This component supports a full Bevel object, free positioning of caption (even vertical!) and transparent display. Customizable picture settings available.

Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10708563
Oops Sorry, and....

TLMDGroupBox
Improved replacement of TGroupBox. This component supports a full Bevel object, free positioning of caption (even vertical!) and transparent display (e.g. when placed on TLMDBackPanel)    
 
 
TLMDRadioButton
Improved replacement of TRadioButton. Supports various 3D-font and layout settings. Customizable picture settings for both states. Transparent display possible.  

Shane
0
 

Author Comment

by:AgeOfWars
ID: 10711107
Thanks Shane,

I know that works but I need to convert the normal group box and radio box delphi provide to transparent colour?

Do you know the code or a component to convert that?

Thanks again
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Accepted Solution

by:
shaneholmes earned 50 total points
ID: 10713063
Try this.

First try it with just the CreateParams overriden, then tru overridding the Paint method.

Shane


  TTransGroup = class(TGroupBox)
  protected
    procedure CreateParams(var Params: TCreateParams); override;
    procedure Paint; override;
    end;


procedure TTransGroup.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  if not (csDesigning in ComponentState)
    then Params.ExStyle:=Params.ExStyle or WS_EX_TRANSPARENT;
  end;

procedure TTransGroup.Paint;
var
  XBitMap: TBitMap;
  XOldDC: HDC;
  XRect: TRect;
begin
{This panel will be transparent only in Run Time}
  if (csDesigning in ComponentState)
    then inherited Paint
  else begin
    XRect:=ClientRect;
    XOldDC:=Canvas.Handle;
    XBitMap:=TBitMap.Create;
    try
      XBitMap.Height:=Height; XBitMap.Width:=Width;
      Canvas.Handle:=XBitMap.Canvas.Handle;
      inherited Paint;
      RedrawWindow(Parent.Handle, @XRect, 0,
                   RDW_ERASE or RDW_INVALIDATE or
                   RDW_NOCHILDREN or RDW_UPDATENOW);
    finally
      Canvas.Handle:=XOldDC;
      Canvas.BrushCopy(XRect, XBitMap, XRect, Color);
      XBitMap.Free;
      end;
    end;
  end;
0
 

Author Comment

by:AgeOfWars
ID: 10729471
Thanks Shane,

I haven't tried yet but will do soon.

Regards,
Ian
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10729491
You haven't tried it yet - yet you accept it as an answer and grade me with a B! WHat'z up with that?

Shane
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 83
code issue 8 99
Delphi - replicating a form 8 64
HTML text in the body of an email (delphi code) 12 96
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…
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

20 Experts available now in Live!

Get 1:1 Help Now