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

RichEditControl.RemoveShortcutKey(Keys, Keys) Method

Removes a command shortcut for all RichEdit views.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v24.2.dll

NuGet Package: DevExpress.Wpf.RichEdit

#Declaration

public void RemoveShortcutKey(
    Keys key,
    Keys modifier
)

#Parameters

Name Type Description
key Keys

A Keys enumeration member specifying a shortcut key.

modifier Keys

A Keys enumeration member specifying a modifier key.

#Remarks

The RichEditControl’s shortcuts should be removed after the control is initialized (e.g. in Window.Loaded event handler).

The following example demonstrates how to remove the Ctrl+O shortcut, which allows users to load a document:

using System;
using System.Windows.Forms;

public MainWindow()
{
    InitializeComponent();
    richEditControl.Loaded += RichEditControl_DocumentLoaded;
}
//...
private void RichEditControl_Loaded(object sender, RoutedEventArgs e) {
    richEditControl.RemoveShortcutKey(Keys.O, Control);
}

To assign a command shortcut, use the RichEditControl.AssignShortcutKeyToCommand method.

See Also