EditingCommands EditingCommands EditingCommands EditingCommands Class

Definition

Provides a standard set of editing related commands.

public ref class EditingCommands abstract sealed
public static class EditingCommands
type EditingCommands = class
Public Class EditingCommands
Inheritance
EditingCommandsEditingCommandsEditingCommandsEditingCommands

Examples

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 null 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);
Dim rTB As New RichTextBox()

EditingCommands.ToggleInsert.Execute(Nothing, rTB)

Remarks

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.

Properties

AlignCenter AlignCenter AlignCenter AlignCenter

Represents the AlignCenter command, which requests that the current paragraph or a selection of paragraphs be centered.

AlignJustify AlignJustify AlignJustify AlignJustify

Represents the AlignJustify command, which requests that the current paragraph or a selection of paragraphs be justified.

AlignLeft AlignLeft AlignLeft AlignLeft

Represents the AlignLeft command, which requests that a selection of content be aligned left.

AlignRight AlignRight AlignRight AlignRight

Represents the AlignRight command, which requests that a selection of content be aligned right.

Backspace Backspace Backspace Backspace

Represents the Backspace command, which requests that a backspace be entered at the current position or over the current selection.

CorrectSpellingError CorrectSpellingError CorrectSpellingError CorrectSpellingError

Represents the CorrectSpellingError command, which requests that any misspelled word at the current position be corrected.

DecreaseFontSize DecreaseFontSize DecreaseFontSize DecreaseFontSize

Represents the DecreaseFontSize command, which requests that the font size for the current selection be decreased by 1 point.

DecreaseIndentation DecreaseIndentation DecreaseIndentation DecreaseIndentation

Represents the DecreaseIndentation command, which requests that indentation for the current paragraph be decreased by one tab stop.

Delete Delete Delete Delete

Represents the Delete command, which requests that the current selection be deleted.

DeleteNextWord DeleteNextWord DeleteNextWord DeleteNextWord

Represents the DeleteNextWord command, which requests that the next word (relative to a current position) be deleted.

DeletePreviousWord DeletePreviousWord DeletePreviousWord DeletePreviousWord

Represents the DeletePreviousWord command, which requests that the previous word (relative to a current position) be deleted.

EnterLineBreak EnterLineBreak EnterLineBreak EnterLineBreak

Represents the EnterLineBreak command, which requests that a line break be inserted at the current position or over the current selection.

EnterParagraphBreak EnterParagraphBreak EnterParagraphBreak EnterParagraphBreak

Represents the EnterParagraphBreak command, which requests that a paragraph break be inserted at the current position or over the current selection.

IgnoreSpellingError IgnoreSpellingError IgnoreSpellingError IgnoreSpellingError

Represents the IgnoreSpellingError command, which requests that any instances of misspelled words at the current position or in the current selection be ignored.

IncreaseFontSize IncreaseFontSize IncreaseFontSize IncreaseFontSize

Represents the IncreaseFontSize command, which requests that the font size for the current selection be increased by 1 point.

IncreaseIndentation IncreaseIndentation IncreaseIndentation IncreaseIndentation

Represents the IncreaseIndentation command, which requests that indentation for the current paragraph be increased by one tab stop.

MoveDownByLine MoveDownByLine MoveDownByLine MoveDownByLine

Represents the MoveDownByLine command, which requests that the caret move down by one line.

MoveDownByPage MoveDownByPage MoveDownByPage MoveDownByPage

Represents the MoveDownByPage command, which requests that the caret move down by one page.

MoveDownByParagraph MoveDownByParagraph MoveDownByParagraph MoveDownByParagraph

Represents the MoveDownByParagraph command, which requests that the caret move down by one paragraph.

MoveLeftByCharacter MoveLeftByCharacter MoveLeftByCharacter MoveLeftByCharacter

Represents the MoveLeftByCharacter command, which requests that the caret move one character left.

MoveLeftByWord MoveLeftByWord MoveLeftByWord MoveLeftByWord

Represents the MoveLeftByWord command, which requests that the caret move one word left.

MoveRightByCharacter MoveRightByCharacter MoveRightByCharacter MoveRightByCharacter

Represents the MoveRightByCharacter command, which requests that the caret move one character right.

MoveRightByWord MoveRightByWord MoveRightByWord MoveRightByWord

Represents the MoveRightByWord command, which requests that the caret move right by one word.

MoveToDocumentEnd MoveToDocumentEnd MoveToDocumentEnd MoveToDocumentEnd

Represents the MoveToDocumentEnd command, which requests that the caret move to the very end of content.

MoveToDocumentStart MoveToDocumentStart MoveToDocumentStart MoveToDocumentStart

Represents the MoveToDocumentStart command, which requests that the caret move to the very beginning of content.

MoveToLineEnd MoveToLineEnd MoveToLineEnd MoveToLineEnd

Represents the MoveToLineEnd command, which requests that the caret move to the end of the current line.

MoveToLineStart MoveToLineStart MoveToLineStart MoveToLineStart

Represents the MoveToLineStart command, which requests that the caret move to the beginning of the current line.

MoveUpByLine MoveUpByLine MoveUpByLine MoveUpByLine

Represents the MoveUpByLine command, which requests that the caret move up by one line.

MoveUpByPage MoveUpByPage MoveUpByPage MoveUpByPage

Represents the MoveUpByPage command, which requests that the caret move up by one page.

MoveUpByParagraph MoveUpByParagraph MoveUpByParagraph MoveUpByParagraph

Represents the MoveUpByParagraph command, which requests that the caret move up by one paragraph.

SelectDownByLine SelectDownByLine SelectDownByLine SelectDownByLine

Represents the SelectDownByLine command, which requests that the current selection be expanded down by one line.

SelectDownByPage SelectDownByPage SelectDownByPage SelectDownByPage

Represents the SelectDownByPage command, which requests that the current selection be expanded down by one page.

SelectDownByParagraph SelectDownByParagraph SelectDownByParagraph SelectDownByParagraph

Represents the SelectDownByParagraph command, which requests that the current selection be expanded down by one paragraph.

SelectLeftByCharacter SelectLeftByCharacter SelectLeftByCharacter SelectLeftByCharacter

Represents the SelectLeftByCharacter command, which requests that the current selection be expanded left by one character.

SelectLeftByWord SelectLeftByWord SelectLeftByWord SelectLeftByWord

Represents the SelectLeftByWord command, which requests that the current selection be expanded left by one word.

SelectRightByCharacter SelectRightByCharacter SelectRightByCharacter SelectRightByCharacter

Represents the SelectRightByCharacter command, which requests that the current selection be expanded right by one character.

SelectRightByWord SelectRightByWord SelectRightByWord SelectRightByWord

Represents the SelectRightByWord command, which requests that the current selection be expanded right by one word.

SelectToDocumentEnd SelectToDocumentEnd SelectToDocumentEnd SelectToDocumentEnd

Represents the SelectToDocumentEnd command, which requests that the current selection be expanded to the very end of content.

SelectToDocumentStart SelectToDocumentStart SelectToDocumentStart SelectToDocumentStart

Represents the SelectToDocumentStart command, which requests that the current selection be expanded to the very beginning of content.

SelectToLineEnd SelectToLineEnd SelectToLineEnd SelectToLineEnd

Represents the SelectToLineEnd command, which requests that the current selection be expanded to the end of the current line.

SelectToLineStart SelectToLineStart SelectToLineStart SelectToLineStart

Represents the SelectToLineStart command, which requests that the current selection be expanded to the beginning of the current line.

SelectUpByLine SelectUpByLine SelectUpByLine SelectUpByLine

Represents the SelectUpByLine command, which requests that the current selection be expanded up by one line.

SelectUpByPage SelectUpByPage SelectUpByPage SelectUpByPage

Represents the SelectUpByPage command, which requests that the current selection be expanded up by one page.

SelectUpByParagraph SelectUpByParagraph SelectUpByParagraph SelectUpByParagraph

Represents the SelectUpByParagraph command, which requests that the current selection be expanded up by one paragraph.

TabBackward TabBackward TabBackward TabBackward

Represents the TabBackward command.

TabForward TabForward TabForward TabForward

Represents the TabForward command.

ToggleBold ToggleBold ToggleBold ToggleBold

Represents the ToggleBold command, which requests that Bold formatting be toggled on the current selection.

ToggleBullets ToggleBullets ToggleBullets ToggleBullets

Represents the ToggleBullets command, which requests that unordered list (also referred to as bulleted list) formatting be toggled on the current selection.

ToggleInsert ToggleInsert ToggleInsert ToggleInsert

Represents the ToggleInsert command, which toggles the typing mode between Insert and Overtype.

ToggleItalic ToggleItalic ToggleItalic ToggleItalic

Represents the ToggleItalic command, which requests that Italic formatting be toggled on the current selection.

ToggleNumbering ToggleNumbering ToggleNumbering ToggleNumbering

Represents the ToggleNumbering command, which requests that ordered list (also referred to as numbered list) formatting be toggled on the current selection.

ToggleSubscript ToggleSubscript ToggleSubscript ToggleSubscript

Represents the ToggleSubscript command, which requests that subscript formatting be toggled on the current selection.

ToggleSuperscript ToggleSuperscript ToggleSuperscript ToggleSuperscript

Represents the ToggleSuperscript command, which requests that superscript formatting be toggled on the current selection.

ToggleUnderline ToggleUnderline ToggleUnderline ToggleUnderline

Represents the ToggleUnderline command, which requests that Underline formatting be toggled on the current selection.

Applies to

See Also