Mega Code Archive

 
Categories / Delphi / Forms
 

Create custom shaped forms

Title: Create custom shaped forms Use CreateXXXRgn, CombineRgn, SetWindowRgn functions. This is a simple example. procedure TForm1.FormCreate(Sender: TObject); var h1,h2,h3: HRGN; begin h1:=CreateEllipticRgn(0,0,100,100); h2:=CreateEllipticRgn(90,0,190,100); h3:=CreateEllipticRgn(180,0,280,100); CombineRgn(h1,h1,h2,RGN_OR); CombineRgn(h1,h1,h3,RGN_OR); SetWindowRgn(Handle,h1,true); DeleteObject(h1); DeleteObject(h2); DeleteObject(h3); end;