EditingCommands.EnterParagraphBreak 屬性

定義

表示 EnterParagraphBreak 命令,這個命令會要求在目前位置或目前選取範圍上插入分段符號。

public:
 static property System::Windows::Input::RoutedUICommand ^ EnterParagraphBreak { System::Windows::Input::RoutedUICommand ^ get(); };
public static System.Windows.Input.RoutedUICommand EnterParagraphBreak { get; }
member this.EnterParagraphBreak : System.Windows.Input.RoutedUICommand
Public Shared ReadOnly Property EnterParagraphBreak As RoutedUICommand

屬性值

RoutedUICommand

所要求的命令。 此命令的預設按鍵動作是 Enter

範例

下列範例示範如何在支援 命令的物件上叫用編輯命令。

在此範例中,做 RichTextBox 為命令目標。 請注意,實 RichTextBoxIInputElement 繼承自 FrameworkElement) 的介面 (,而且它包含許多編輯命令的原生支援。

方法的第一個引數 Execute 是命令參數。 大部分編輯命令都會忽略命令參數;一般而言,此參數應該 null 用於編輯命令。

第二個引數會指定要路由傳送命令的物件。 這個物件必須實作 IInputElement 介面,而且應該包含指定命令的處理常式。 一般而言,在未處理命令的物件上叫用時,會忽略命令。

RichTextBox rTB = new RichTextBox();

EditingCommands.ToggleInsert.Execute(null, rTB);
Dim rTB As New RichTextBox()

EditingCommands.ToggleInsert.Execute(Nothing, rTB)

備註

此命令相當於按下 ENTER 鍵的使用者。

沒有任何實際實作會回應任何指定物件上的此命令;在許多情況下,回應命令的實作是應用程式寫入器的責任。

當 屬性 true) 時 AcceptsReturn ,和 (原生支援 TextBox RichTextBox 此命令。

重要

除非 AcceptsReturn text 元素的 屬性設定為 true ,否則此命令不會影響文字元素。

XAML Attribute Usage

<object property="EnterParagraphBreak"/>  

適用於

另請參閱