New to Telerik UI for WinFormsStart a free 30-day trial

Keyboard Support

Updated over 6 months ago

Telerik RadRichTextEditor for WinForms supports shortcuts. There are default key-bindings defined for the most widely used operations, namely:

ActionHotkey
CopyCtrl+C
PasteCtrl+V
CutCtrl+X
DeleteDelete
UndoCtrl+Z
RedoCtrl+Y
InsertLineBreakShift+Enter
InsertPageBreakCtrl+Enter
ToggleBoldCtrl+B, Ctrl+Shift+B
ToggleItalicCtrl+I, Ctrl+Shift+I
ToggleSuperscriptCtrl+'+'
ToggleSubscriptCtrl+Shift+'+'
ToggleUnderlineCtrl+U
ClearFormattingCtrl+Space
Copy FormattingCtrl+Shift+C
Paste FormattingCtrl+Shift+V
Cancel Format PainterEsc
ChangeTextAlignment with parameter RadTextAlignment.JustifyCtrl+J
ChangeTextAlignment with parameter RadTextAlignment.RightCtrl+R
ChangeTextAlignment with parameter RadTextAlignment.LeftCtrl+L
ChangeTextAlignment with parameter RadTextAlignment.CenterCtrl+E
SelectAllCtrl+A
MoveCaret with parameter MoveCaretDirections.PreviousLeft Arrow
MoveCaret with parameter MoveCaretDirections.NextRight Arrow
MoveCaret with parameter MoveCaretDirections.PreviousWordCtrl+Left Arrow
MoveCaret with parameter MoveCaretDirections.NextWordCtrl+Right Arrow
MoveCaret with parameter MoveCaretDirections.UpUpper Arrow
MoveCaret with parameter MoveCaretDirections.DownDown Arrow
MoveCaret with parameter MoveCaretDirections. ParagraphStartCtrl+Upper Arrow
MoveCaret with parameter MoveCaretDirections. ParagraphEndCtrl+Down Arrow
MoveCaret with parameter MoveCaretDirections.HomeHome
MoveCaret with parameter MoveCaretDirections.DocumentStartCtrl+Home
MoveCaret with parameter MoveCaretDirections.EndEnd
MoveCaret with parameter MoveCaretDirections.DocumentEndCtrl+End
MoveCaret with parameter MoveCaretDirections.PageUpPageUp
MoveCaret with parameter MoveCaretDirections.PageDownPageDown
ShowFindReplaceDialogCtrl+F
ShowFontPropertiesDialogCtrl+D
ShowInsertHyperlinkDialogCtrl+K

Now, these key shortcuts can be overridden and customized to the liking of the user. This can be achieved by creating a custom RichTextEditorInputBehavior descendant:

C#
    
public class MyInputBehavior : Telerik.WinForms.RichTextEditor.RichTextEditorInputBehavior
{
    public MyInputBehavior(RadRichTextBox editor) : base(editor)
    {
    }
    protected override void PerformCopyOperation(System.Windows.Forms.KeyEventArgs e)
    {
        base.PerformCutOperation(e);
    }      
}

The default behavior can be changed like this:

C#
            
radRichTextEditor1.InputHandler = new MyInputBehavior(radRichTextEditor1.RichTextBoxElement);

Another way to customize the control behavior is to use the PreviewEditorKeyDown event. For example, pressing RightAlt causes Control and Alt to be sent as arguments to the PreviewKeyDown event. Thus, RightAlt+E triggers a formatting command for paragraph alignment instead of inputting the ę character. In that case, you can handle the PreviewEditorKeyDown event in the following way:

C#
    
void RichTextBoxElement_PreviewEditorKeyDown(object sender, PreviewEditorKeyEventArgs e)
{
    if ((Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)))
    {
        e.SuppressDefaultAction = true;
    }
}

See Also

In this article
See Also
Not finding the help you need?
Contact Support