Skip to main content

RichEditControl.DeselectAll() Method

Specifies that no content is selected in the control.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v22.2.dll

NuGet Package: DevExpress.Win.RichEdit

Declaration

public void DeselectAll()

Example

The following code resets document selection and sets the caret to the end of the former selection.

The RichEditControl instance is passed to the BarItem.ItemClick event handler using the BarItem.Tag property.

View Example

static void buttonCustomAction_ItemClick_Deselect(object sender, ItemClickEventArgs e) {
    RichEditControl richEdit = e.Item.Tag as RichEditControl;
    DocumentPosition endOfSelection = richEdit.Document.Selection.End;
    richEdit.DeselectAll();
    richEdit.Document.CaretPosition = endOfSelection;
}
See Also