OnResizeRequest (Delphi)
Description
The following code resizes the rich edit control to accommodate growing or shortening lines of text. This example requires a button, a TEdit, and a TRichEdit. Double-click the TRichEdit OnResizeRequest event to create the event handler.
Code
procedure TForm1.Button1Click(Sender: TObject);
begin
RichEdit1.Lines.Add(Edit1.Text);
end;
procedure TForm1.RichEdit1ResizeRequest(Sender: TObject; Rect: TRect);
begin
(Sender as TRichEdit).BoundsRect := Rect;
end;