RAD Studio
ContentsIndex
PreviousUpNext
Deleting Selected Text

You can delete the selected text in an edit component without cutting it to the clipboard. To do so, call the ClearSelection method. For example, if you have a Delete item on the Edit menu, your code could look like this:

procedure TEditForm.Delete(Sender: TObject);
begin
  RichEdit1.ClearSelection;
end;

 

void __fastcall TMainForm::EditDeleteClick(TObject *Sender)
{
  RichEdit1->ClearSelection();
}
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!