unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormDblClick(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var rgn: HRGN; begin BeginPath(Canvas.Handle); SetBKMode(Canvas.Handle, TRANSPARENT); Canvas.Font.Size := 56; Canvas.Font.Style := [fsBold]; Canvas.TextOut(12, 12, 'Delphi'); EndPath(Canvas.Handle); rgn := PathToRegion(Canvas.Handle); Self.Color := clRed; SetWindowRgn(Handle, rgn, True); end; procedure TForm1.FormDblClick(Sender: TObject); begin Close; end; end.标签:Canvas,Handle,Sender,异形,创建,end,TForm1,TObject,窗口 From: https://www.cnblogs.com/lucken2000/p/17397060.html