Solved

Component to make existing radio group box and radio button transparent

Posted on 2004-03-29
6
638 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
[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 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
Independent Software Vendors: 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 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

Technology Partners: 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!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

717 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