본문 바로가기

Delphi/꿀팁

TForm 배경 투명하게 만들기

uses
  .., Vcl.Controls, Vcl.Graphics;

type
  TForm1 = class(TForm)
    ..
    procedure FormCreate(Sender: TObject);
  private
    procedure CreateParams(var Params: TCreateParams); override;
  end;
  
implementation

procedure TForm1.FormCreate(Sender: TObject);
begin
  Self.Brush.Style := bsClear;
end;

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  
  Params.ExStyle := WS_EX_TRANSPARENT or WS_EX_TOPMOST;
end;
반응형