New to Telerik UI for WinForms? Start a free 30-day trial

Changes the document between flow, unwrapped-flow, and paged layout modes.

Definition

Constructors

Initializes the command and subscribes to the editor's layout-mode change notifications.

C#
public ChangeLayoutModeCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The editor whose document layout mode can be changed.

Properties

Disallows execution while document protection is enforced, regardless of the caret position.

C#
protected override CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

Overrides: RichTextBoxCommandBase.CanExecuteBehaviorInProtectedDocument

Allows this view-only command to run when the current selection intersects a read-only range.

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Methods

Changes the editor's document layout mode when the parameter is a DocumentLayoutMode or a string that parses to one.

C#
protected override void ExecuteOverride(object parameter)
Parameters:parameterobject

A layout mode or its parseable string name. Other values are ignored.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)

Raises LayoutModeChanged with the supplied mode values.

C#
protected virtual void OnLayoutModeChanged(DocumentLayoutMode oldValue, DocumentLayoutMode newValue)
Parameters:oldValueDocumentLayoutMode

The mode last observed by this command before the notification. On the first notification, it may be the enum default if the command was created after the document had already changed modes.

newValueDocumentLayoutMode

The editor's current document layout mode.

Updates derived command state after the current span or paragraph style changes.

C#
protected override void UpdateSpanStyle()

Overrides: RichTextBoxCommandBase.UpdateSpanStyle()

Events

Occurs when the associated editor reports a document layout-mode change, including changes made outside this command.

C#
public event EventHandler<StylePropertyChangedEventArgs<DocumentLayoutMode>> LayoutModeChanged