EditingCommands Class
Provides a standard set of editing related commands.
Assembly: PresentationFramework (in PresentationFramework.dll)
The following table shows the editing commands and the associated default key gestures (with key names from the Key and ModifierKeys enumerations).
Editing command | Default key gesture |
|---|---|
Ctrl+E | |
Ctrl+J | |
Ctrl+L | |
Ctrl+R | |
Backspace | |
no default key gesture | |
Ctrl+OemOpenBrackets | |
Ctrl+Shift+T | |
Delete | |
Ctrl+Delete | |
Ctrl+Backspace | |
Shift+Enter | |
Enter | |
no default key gesture | |
Ctrl+OemCloseBrackets | |
Ctrl+T | |
Down | |
PageDown | |
Ctrl+Down | |
Left | |
Ctrl+Left | |
Right | |
Ctrl+Right | |
Ctrl+End | |
Ctrl+Home | |
End | |
Home | |
Up | |
PageUp | |
Ctrl+Up | |
Shift+Down | |
Shift+PageDown | |
Ctrl+Shift+Down | |
Shift+Left | |
Ctrl+Shift+Left | |
Shift+Right | |
Ctrl+Shift+Right | |
Ctrl+Shift+End | |
Ctrl+Shift+Home | |
Shift+End | |
Shift+Home | |
Shift+Up | |
Shift+PageUp | |
Ctrl+Shift+Up | |
Shift+Tab | |
Tab | |
Ctrl+B | |
Ctrl+Shift+L | |
Insert | |
Ctrl+I | |
Ctrl+Shift+N | |
Ctrl+OemPlus | |
Ctrl+Shift+OemPlus | |
Ctrl+U |
Caret movement commands and selection expanding commands share a common set of default key gestures, the general difference being the addition of the Shift key to differentiate selection commands from caret movement commands. For example, the MoveLeftByCharacter command has a default key gesture of Left, and the corresponding SelectLeftByCharacter command has a default key gesture of Shift+Left.
In general, the command definitions provided by the EditingCommands class do not make use of command parameters (the parameter parameter expected by the Execute method).
For more information on commands and commanding, see Input Overview.
The following example demonstrates how to invoke an editing command on an object that supports the command.
For this example, a RichTextBox serves as the command target. Note that RichTextBox implements the IInputElement interface (inherited from FrameworkElement), and that it includes native support for many editing commands.
The first argument for the Execute method is a command parameter. Most editing commands ignore the command parameter; in general, this parameter should be Nothing for editing commands.
The second argument specifies the object to which the command will be routed. This object must implement the IInputElement interface, and should include a handler for the specified command. Generally, a command is ignored when invoked on an object that does not handle the command.
RichTextBox rTB = new RichTextBox(); EditingCommands.ToggleInsert.Execute(null, rTB);
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.