RichEditControl.Cut() Method
Removes the selection from the document, and places it on the Clipboard.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.XtraRichEdit.v20.1.dll
NuGet Package: DevExpress.Win.RichEdit
Declaration
Example
The following code finds all occurrences of the “Custom Action” phrase using the SubDocument.FindAll method, selects and cuts them.
The RichEditControl instance is passed to the BarItem.ItemClick event handler using the BarItem.Tag property.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/winforms-the-richeditcontrols-common-api-t210437
static void buttonCustomAction_ItemClick_Cut(object sender, ItemClickEventArgs e) {
RichEditControl richEdit = e.Item.Tag as RichEditControl;
DocumentRange[] foundRanges = richEdit.Document.FindAll("Custom Action", SearchOptions.None);
for(int i = 0; i < foundRanges.Length; i++) {
richEdit.Document.Selection = foundRanges[i];
richEdit.Cut();
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Cut() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.