Board index » delphi » Trasparent Forms

Trasparent Forms

Ho can I Make a form trasparent?
Also i i move it
Please answer in e-mail
Regards Kirys

 

Re:Trasparent Forms


Quote
Kirys wrote:

> Ho can I Make a form trasparent?
> Also i i move it
> Please answer in e-mail
> Regards Kirys

Hi,

here is an example you can find in the Code Librarian of GExperts by
Gerald Nunn.

{Add a button to a form and try this:}

procedure TForm1.FormCreate(Sender: TObject);
var
  FullRgn, ClientRgn, ButtonRgn: THandle;
  Margin, x, y: Integer;
begin
  Margin := (Width - ClientWidth) div 2;
  FullRgn := CreateRectRgn(0, 0, Width, Height);
  x := Margin;
  y := Height - ClientHeight - Margin;
  ClientRgn := CreateRectRgn(x, y, x + ClientWidth, y + ClientHeight);
  CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
  x := x + Button1.Left;
  y := y + Button1.Top;
  ButtonRgn := CreateRectRgn(x, y, x + Button1.Width, y +
Button1.Height);
  CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR);
  SetWindowRgn(Handle, FullRgn, TRUE);
end;

Regards

Kerstin

Other Threads