Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IdxRichEditSubDocument.Delete(IdxRichEditDocumentRange) Method

Deletes the specified text range from the document.

#Declaration

Delphi
procedure Delete(const ARange: IdxRichEditDocumentRange);

#Parameters

Name Type Description
ARange IdxRichEditDocumentRange

The deleted document range.

#Remarks

Call the Delete procedure to delete a document range.

#Code Example: Delete Selected Text

The following code example deletes all selected text ranges:

var
  ADocument: IdxRichEditDocument;
  I: Integer;
begin
  ADocument := dxRichEditControl1.Document;
  ADocument.BeginUpdate;
  for I := ADocument.Selections.Count - 1 downto 0 do // Iterates through all selected document ranges
    ADocument.Delete(ADocument.Selections[I]);
  ADocument.EndUpdate;  // Applies all pending changes to the document and unlocks document updates
end;

See Also