通过


RichTextBox.SelectedRtf 属性

定义

获取或设置控件中当前选定的格式文本格式 (RTF) 格式的文本。

public:
 property System::String ^ SelectedRtf { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
public string SelectedRtf { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.SelectedRtf : string with get, set
Public Property SelectedRtf As String

属性值

控件中选定的 RTF 文本。

属性

注解

此属性使你能够获取控件中的选定文本,包括 RTF 格式代码。 可以使用此属性从控件复制文本,完成格式设置,并将文本粘贴到接受 RTF 格式文本的其他应用程序中,例如Microsoft Word 和 Windows WordPad。 若要获取所选文本,而不使用 RTF 格式代码,请使用该 SelectedText 属性。

如果未选择任何文本,则此属性中指定的文本将插入插入点。 如果选择了文本,则分配给此属性的任何文本将替换所选文本。

适用于

另请参阅