//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "OnResizeRequest.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: OnResizeRequest
// Event: ComCtrls.TCustomRichEdit.OnResizeRequest

// BeginCode
/*
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 on the TRichEdit OnResizeRequest event
to create the event handler.
*/
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;
}
// EndCode
// EndExample: OnResizeRequest
//---------------------------------------------------------------------------
