TControlPerform (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

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.

Code

void __fastcall TForm1::Button1Click(TObject *Sender)
{
	RichEdit1->SelStart = StrToInt(MaskEdit1->Text);
	Edit1->Text = IntToStr(RichEdit1->SelStart);
	RichEdit1->Perform(EM_SCROLLCARET, 0, 0);
	RichEdit1->SetFocus();
}

Uses