RichEditControl.DeselectAll() Method

Specifies that no content is selected in the control.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v21.2.dll

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