EditingCommands Class

Provides a standard set of editing related commands.

System::Object
  System.Windows.Documents::EditingCommands

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

public ref class EditingCommands abstract sealed

The EditingCommands type exposes the following members.

  NameDescription
Public propertyStatic memberAlignCenterRepresents the AlignCenter command, which requests that the current paragraph or a selection of paragraphs be centered.
Public propertyStatic memberAlignJustifyRepresents the AlignJustify command, which requests that the current paragraph or a selection of paragraphs be justified.
Public propertyStatic memberAlignLeftRepresents the AlignLeft command, which requests that a selection of content be aligned left.
Public propertyStatic memberAlignRightRepresents the AlignRight command, which requests that a selection of content be aligned right.
Public propertyStatic memberBackspaceRepresents the Backspace command, which requests that a backspace be entered at the current position or over the current selection.
Public propertyStatic memberCorrectSpellingErrorRepresents the CorrectSpellingError command, which requests that any misspelled word at the current position be corrected.
Public propertyStatic memberDecreaseFontSizeRepresents the DecreaseFontSize command, which requests that the font size for the current selection be decreased by 1 point.
Public propertyStatic memberDecreaseIndentationRepresents the DecreaseIndentation command, which requests that indentation for the current paragraph be decreased by one tab stop.
Public propertyStatic memberDeleteRepresents the Delete command, which requests that the current selection be deleted.
Public propertyStatic memberDeleteNextWordRepresents the DeleteNextWord command, which requests that the next word (relative to a current position) be deleted.
Public propertyStatic memberDeletePreviousWordRepresents the DeletePreviousWord command, which requests that the previous word (relative to a current position) be deleted.
Public propertyStatic memberEnterLineBreakRepresents the EnterLineBreak command, which requests that a line break be inserted at the current position or over the current selection.
Public propertyStatic memberEnterParagraphBreakRepresents the EnterParagraphBreak command, which requests that a paragraph break be inserted at the current position or over the current selection.
Public propertyStatic memberIgnoreSpellingErrorRepresents the IgnoreSpellingError command, which requests that any instances of misspelled words at the current position or in the current selection be ignored.
Public propertyStatic memberIncreaseFontSizeRepresents the IncreaseFontSize command, which requests that the font size for the current selection be increased by 1 point.
Public propertyStatic memberIncreaseIndentationRepresents the IncreaseIndentation command, which requests that indentation for the current paragraph be increased by one tab stop.
Public propertyStatic memberMoveDownByLineRepresents the MoveDownByLine command, which requests that the caret move down by one line.
Public propertyStatic memberMoveDownByPageRepresents the MoveDownByPage command, which requests that the caret move down by one page.
Public propertyStatic memberMoveDownByParagraphRepresents the MoveDownByParagraph command, which requests that the caret move down by one paragraph.
Public propertyStatic memberMoveLeftByCharacterRepresents the MoveLeftByCharacter command, which requests that the caret move one character left.
Public propertyStatic memberMoveLeftByWordRepresents the MoveLeftByWord command, which requests that the caret move one word left.
Public propertyStatic memberMoveRightByCharacterRepresents the MoveRightByCharacter command, which requests that the caret move one character right.
Public propertyStatic memberMoveRightByWordRepresents the MoveRightByWord command, which requests that the caret move right by one word.
Public propertyStatic memberMoveToDocumentEndRepresents the MoveToDocumentEnd command, which requests that the caret move to the very end of content.
Public propertyStatic memberMoveToDocumentStartRepresents the MoveToDocumentStart command, which requests that the caret move to the very beginning of content.
Public propertyStatic memberMoveToLineEndRepresents the MoveToLineEnd command, which requests that the caret move to the end of the current line.
Public propertyStatic memberMoveToLineStartRepresents the MoveToLineStart command, which requests that the caret move to the beginning of the current line.
Public propertyStatic memberMoveUpByLineRepresents the MoveUpByLine command, which requests that the caret move up by one line.
Public propertyStatic memberMoveUpByPageRepresents the MoveUpByPage command, which requests that the caret move up by one page.
Public propertyStatic memberMoveUpByParagraphRepresents the MoveUpByParagraph command, which requests that the caret move up by one paragraph.
Public propertyStatic memberSelectDownByLineRepresents the SelectDownByLine command, which requests that the current selection be expanded down by one line.
Public propertyStatic memberSelectDownByPageRepresents the SelectDownByPage command, which requests that the current selection be expanded down by one page.
Public propertyStatic memberSelectDownByParagraphRepresents the SelectDownByParagraph command, which requests that the current selection be expanded down by one paragraph.
Public propertyStatic memberSelectLeftByCharacterRepresents the SelectLeftByCharacter command, which requests that the current selection be expanded left by one character.
Public propertyStatic memberSelectLeftByWordRepresents the SelectLeftByWord command, which requests that the current selection be expanded left by one word.
Public propertyStatic memberSelectRightByCharacterRepresents the SelectRightByCharacter command, which requests that the current selection be expanded right by one character.
Public propertyStatic memberSelectRightByWordRepresents the SelectRightByWord command, which requests that the current selection be expanded right by one word.
Public propertyStatic memberSelectToDocumentEndRepresents the SelectToDocumentEnd command, which requests that the current selection be expanded to the very end of content.
Public propertyStatic memberSelectToDocumentStartRepresents the SelectToDocumentStart command, which requests that the current selection be expanded to the very beginning of content.
Public propertyStatic memberSelectToLineEndRepresents the SelectToLineEnd command, which requests that the current selection be expanded to the end of the current line.
Public propertyStatic memberSelectToLineStartRepresents the SelectToLineStart command, which requests that the current selection be expanded to the beginning of the current line.
Public propertyStatic memberSelectUpByLineRepresents the SelectUpByLine command, which requests that the current selection be expanded up by one line.
Public propertyStatic memberSelectUpByPageRepresents the SelectUpByPage command, which requests that the current selection be expanded up by one page.
Public propertyStatic memberSelectUpByParagraphRepresents the SelectUpByParagraph command, which requests that the current selection be expanded up by one paragraph.
Public propertyStatic memberTabBackwardRepresents the TabBackward command.
Public propertyStatic memberTabForwardRepresents the TabForward command.
Public propertyStatic memberToggleBoldRepresents the ToggleBold command, which requests that Bold formatting be toggled on the current selection.
Public propertyStatic memberToggleBulletsRepresents the ToggleBullets command, which requests that unordered list (also referred to as bulleted list) formatting be toggled on the current selection.
Public propertyStatic memberToggleInsertRepresents the ToggleInsert command, which toggles the typing mode between Insert and Overtype.
Public propertyStatic memberToggleItalicRepresents the ToggleItalic command, which requests that Italic formatting be toggled on the current selection.
Public propertyStatic memberToggleNumberingRepresents the ToggleNumbering command, which requests that ordered list (also referred to as numbered list) formatting be toggled on the current selection.
Public propertyStatic memberToggleSubscriptRepresents the ToggleSubscript command, which requests that subscript formatting be toggled on the current selection.
Public propertyStatic memberToggleSuperscriptRepresents the ToggleSuperscript command, which requests that superscript formatting be toggled on the current selection.
Public propertyStatic memberToggleUnderlineRepresents the ToggleUnderline command, which requests that Underline formatting be toggled on the current selection.
Top

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 nullptr 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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft