TMemo with rounded corners  

Send By: Radikal (Q3 Team)
Web : http://www.q3.nu
Email: radikal@q3.nu
Date: 03/01/03

Tip accessed 648 times

 



 procedure TForm1.Button1Click(Sender: TObject);

   procedure MemoRedondo(QueMemo: TMemo);
   var
     rect  : TRect;
     rgn   : HRGN;

   begin
     rect := QueMemo.ClientRect;
     rgn := CreateRoundRectRgn(  rect.Left,
                                 rect.top,
                                 rect.right,
                                 rect.bottom, 20, 20);
     QueMemo.BorderStyle := bsNone;
     QueMemo.Perform(EM_GETRECT, 0, lparam(@rect));
     InflateRect(rect, -5, -5);
     QueMemo.Perform(EM_SETRECTNP, 0, lparam(@rect));
     SetWindowRgn(QueMemo.Handle, rgn, true);
   end;

 begin
   MemoRedondo(Memo1);
 end;