RichTextBox.SelectedRtf RichTextBox.SelectedRtf RichTextBox.SelectedRtf RichTextBox.SelectedRtf Property


获取或设置控件中当前选择的 RTF 格式的格式化文本。Gets or sets the currently selected rich text format (RTF) formatted text in the control.

 property System::String ^ SelectedRtf { System::String ^ get(); void set(System::String ^ value); };
public string SelectedRtf { get; set; }
member this.SelectedRtf : string with get, set
Public Property SelectedRtf As String


控件中选定的 RTF 文本。The selected RTF text in the control.


此属性使您能够获取控件中选定的文本,包括 RTF 格式代码。This property enables you to obtain the selected text in the control, including the RTF formatting codes. 您可以使用此属性从控件复制文本,使用格式设置完成,并将文本粘贴到接受 RTF 格式文本的其他应用程序(例如 Microsoft Word 和 Windows 写字板)中。You can use this property to copy text from your control, complete with formatting, and paste the text in other applications that accept RTF formatted text, such as Microsoft Word and Windows WordPad. 若要获取所选文本,而不使用 RTF 格式代码SelectedText ,请使用属性。To get the selected text, without RTF formatting codes, use the SelectedText property.

如果当前未选择任何文本,则在插入点处插入此属性中指定的文本。If no text is currently selected, the text specified in this property is inserted at the insertion point. 如果选择文本,则分配给此属性的任何文本都将替换选定文本。If text is selected, any text assigned to this property replaces the selected text.