Como fazer formulário transparente

Delphi

30/09/2003

Gostaria de criar um formulário transparente.


J@ck

J@ck

Curtidas 0

Respostas

Mmtoor

Mmtoor

30/09/2003

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormShow(Sender: TObject);
begin
Brush.Style := BsClear;
end;
end.

MMTOOR 2003


GOSTEI 0
Ljr

Ljr

30/09/2003

Assim tambem funciona, tente colocar no onCreate ou onPaint do seu form

var 
  AControl: TControl; 
  A, Margin, X, Y, CtlX, CtlY: 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); 
  for A := 0 to ControlCount - 1 do 
  begin 
    AControl := Controls[A]; 
    if (AControl is TWinControl) or (AControl is TGraphicControl) then with AControl do 
      begin 
        if Visible then 
        begin 
          CtlX   := X + Left; 
          CtlY   := Y + Top; 
          CtlRgn := CreateRectRgn(CtlX, CtlY, CtlX + Width, CtlY + Height); 
          CombineRgn(FullRgn, FullRgn, CtlRgn, RGN_OR); 
        end; 
      end; 
  end; 
  SetWindowRgn(Handle, FullRgn, True); 
end;



GOSTEI 0
POSTAR