Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
EditingCommands Class

Updated: November 2007

Provides a standard set of editing related commands.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

Visual Basic (Declaration)
Public NotInheritable Class EditingCommands
Visual Basic (Usage)
You do not need to declare an instance of a static class in order to access its members.
C#
public static class EditingCommands
Visual C++
public ref class EditingCommands abstract sealed
J#
public final class EditingCommands
JScript
public final class EditingCommands
XAML
You cannot directly create an instance of this class in XAML.

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

AlignCenter

Ctrl+E

AlignJustify

Ctrl+J

AlignLeft

Ctrl+L

AlignRight

Ctrl+R

Backspace

Backspace

CorrectSpellingError

no default key gesture

DecreaseFontSize

Ctrl+OemOpenBrackets

DecreaseIndentation

Ctrl+Shift+T

Delete

Delete

DeleteNextWord

Ctrl+Delete

DeletePreviousWord

Ctrl+Backspace

EnterLineBreak

Shift+Enter

EnterParagraphBreak

Enter

IgnoreSpellingError

no default key gesture

IncreaseFontSize

Ctrl+OemCloseBrackets

IncreaseIndentation

Ctrl+T

MoveDownByLine

Down

MoveDownByPage

PageDown

MoveDownByParagraph

Ctrl+Down

MoveLeftByCharacter

Left

MoveLeftByWord

Ctrl+Left

MoveRightByCharacter

Right

MoveRightByWord

Ctrl+Right

MoveToDocumentEnd

Ctrl+End

MoveToDocumentStart

Ctrl+Home

MoveToLineEnd

End

MoveToLineStart

Home

MoveUpByLine

Up

MoveUpByPage

PageUp

MoveUpByParagraph

Ctrl+Up

SelectDownByLine

Shift+Down

SelectDownByPage

Shift+PageDown

SelectDownByParagraph

Ctrl+Shift+Down

SelectLeftByCharacter

Shift+Left

SelectLeftByWord

Ctrl+Shift+Left

SelectRightByCharacter

Shift+Right

SelectRightByWord

Ctrl+Shift+Right

SelectToDocumentEnd

Ctrl+Shift+End

SelectToDocumentStart

Ctrl+Shift+Home

SelectToLineEnd

Shift+End

SelectToLineStart

Shift+Home

SelectUpByLine

Shift+Up

SelectUpByPage

Shift+PageUp

SelectUpByParagraph

Ctrl+Shift+Up

TabBackward

Shift+Tab

TabForward

Tab

ToggleBold

Ctrl+B

ToggleBullets

Ctrl+Shift+L

ToggleInsert

Insert

ToggleItalic

Ctrl+I

ToggleNumbering

Ctrl+Shift+N

ToggleSubscript

Ctrl+OemPlus

ToggleSuperscript

Ctrl+Shift+OemPlus

ToggleUnderline

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 nullNothingnullptra null reference (Nothing in Visual Basic) 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.

C#
RichTextBox rTB = new RichTextBox();

EditingCommands.ToggleInsert.Execute(null, rTB);

System..::.Object
  System.Windows.Documents..::.EditingCommands
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista

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.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker