Title: How to Define a border for Memos
procedure TForm1.Button1Click(Sender: TObject);
const
BORDER_WIDTH = 20;
var
Rect: TRect;
begin
SendMessage(Memo1.Handle, EM_GETRECT, 0, Longint(@Rect));
Rect.Top := BORDER_WIDTH;
Rect.Left := BORDER_WIDTH;
Rect.Right := Memo1.Width - BORDER_WIDTH;
Rect.Bottom := Memo1.Height - BORDER_WIDTH;
SendMessage(Memo1.Handle, EM_SETRECT, 0, Longint(@Rect));
Memo1.Refresh;
end;