RichEditControl.DeselectAll() Method

Specifies that no content is selected in the control.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v20.1.dll

Declaration

public void DeselectAll()
Public Sub DeselectAll

Examples

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.

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