OnResizeRequest (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following code resizes the rich edit control to accommodate growing or shrinking 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

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  RichEdit1->Lines->Add(Edit1->Text);
}

void __fastcall TForm1::RichEdit1ResizeRequest(TObject *Sender, TRect &Rect)
{
  (dynamic_cast<TRichEdit *>(Sender))->BoundsRect = Rect;
}

Uses