Selecting All Text

From RAD Studio
Jump to: navigation, search

Go Up to Working with Text in Controls

The SelectAll method selects the entire contents of an edit control, such as a rich edit or memo component. This is especially useful when the component's contents exceed the visible area of the component. In most other cases, users select text with either keystrokes or mouse dragging.

To select the entire contents of a rich edit or memo control, call the RichEdit1 control's SelectAll method.

For example:

 procedure TMainForm.SelectAll(Sender: TObject);
 begin
   RichEdit1.SelectAll;  { select all text in RichEdit }
 end;
void __fastcall TMainForm::SelectAll(TObject *Sender)
{
    RichEdit1->SelectAll(); // select all text in RichEdit
}

See Also