procedure DrawRounded(Control: TWinControl) ;
var
R: TRect;
Rgn: HRGN;
begin
with Control do
begin
R := ClientRect;
rgn := CreateRoundRectRgn(R.Left, R.Top, R.Right, R.Bottom, 20, 20) ;
Perform(EM_GETRECT, 0, lParam(@r)) ;
InflateRect(r, - 4, - 4) ;
Perform(EM_SETRECTNP, 0, lParam(@r)) ;
SetWindowRgn(Handle, rgn, True) ;
Invalidate;
end;
end;
procedure TForm1.FormCreate(Sender: TObject) ;
begin
DrawRounded(Panel1) ;
Memo1.BorderStyle := bsNone;
DrawRounded(Memo1) ;
Edit1.BorderStyle := bsNone;
DrawRounded(Edit1) ;
end;