Delphi Tips&Tricks News   Tips   .NET Software   VCL Software   Search   Contacts
Ultimate Pack - special offer!

Ultimate Pack  hot!
Image Editor  new!
Runtime Fusion
Form Designer
Object Inspector
Print Suite Pro
Commented Image
Delphi Toys
WinDowse
Delphi Bonus
TMS Scripter Studio
Form Designer VB
Form Designer .NET

...get more...
for Delphi.NET, C#, VB.NET
for Delphi VCL, BCB 3-6

WinAPI Online
Unix Manual Pages
MegaDetailed.NET
in3steps.com
cdtrrracks.com new!

Blogspot  greatis.blogspot.com

Get transparent form - Forms - Tips & Tricks - Greatis Delphi Pages

If you want to create form with transparent background, then you should override Create and Resize methods of your Form.
CombineRgn function is basic function for realisation of this idea.


constructor TForm1.Create(AOwner: TComponent);
begin
  inherited;
  HorzScrollBar.Visible:=False;
  VertScrollBar.Visible:=False;
  NewWindowRgn;
end;

procedure TForm1.NewWindowRgn;
var
  i, CoordX, CoordY: Integer;
  FormRgn, NewRgn: THandle;
begin
  CoordX:=(Width-ClientWidth) div 2;
  CoordY:=Height-ClientHeight-4;

  FormRgn:=CreateRectRgn(0, 0, Width, Height);

  NewRgn:= CreateRectRgn(
    CoordX,
    CoordY,
    CoordX+ClientWidth,
    CoordY+ClientHeight);
  CombineRgn(FormRgn, FormRgn, NewRgn, RGN_DIFF);

  for i:= 0 to ControlCount -1 do
    with Controls[i] do
    begin
      NewRgn:= CreateRectRgn(
        CoordX + Left,
        CoordY + Top,
        CoordX + Left + Width,
        CoordY + Top + Height);
      CombineRgn(FormRgn, FormRgn, NewRgn, RGN_OR);
    end;

  SetWindowRgn(Handle, FormRgn, True);
end;

procedure TForm1.Resize;
begin
  inherited;
  NewWindowRgn;
end;
For more
Delphi Help

Download source