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

#include <vcl.h>
#pragma hdrstop

#include "TControlPerform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  char const *Path = "../overview.rtf";
  RichEdit1->PlainText = False;
  RichEdit1->Lines->LoadFromFile(Path);
  Edit1->ReadOnly = True;
  Edit1->Text = '0';
}

// BeginExample: TControlPerform
// Method: Controls.TControl.Perform
// Method: Controls.TWinControl.SetFocus

// Warning: Could use a check for integer for MaskEdit1 instead of breaking.

// BeginCode
/*
The following example demonstrates the use of the Perform method
to send a windows message. The EM_SCROLLCARET message scrolls the
caret in the rich edit into view. The caret position is set to the
contents of the mask edit prior to calling Perform.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	RichEdit1->SelStart = StrToInt(MaskEdit1->Text);
	Edit1->Text = IntToStr(RichEdit1->SelStart);
	RichEdit1->Perform(EM_SCROLLCARET, 0, 0);
	RichEdit1->SetFocus();
}
// EndCode
// EndExample: TControlPerform

void __fastcall TForm1::RichEdit1Click(TObject *Sender)
{
  Edit1->Text = IntToStr(RichEdit1->SelStart);
}
//---------------------------------------------------------------------------

