//设置TMemo组件的边界
procedure TForm1.Button1Click(Sender: TObject);
var
area: TRect;
begin
SendMessage(memo1.Handle ,em_getrect,0,longint(@area));
area.Left := 30;
area.Top := 10;
area.Right := area.Right - 29;
area.Bottom := area.Bottom - 29;
SendMessage(memo1.Handle ,em_setrect,0,longint(@area));
memo1.Refresh ;
end;