RichTextBox.Rtf 属性

获取或设置 RichTextBox 控件的文本,包括所有 RTF 格式代码。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Property Rtf As String
用法
Dim instance As RichTextBox
Dim value As String

value = instance.Rtf

instance.Rtf = value
public string Rtf { get; set; }
public:
property String^ Rtf {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Rtf ()

/** @property */
public void set_Rtf (String value)
public function get Rtf () : String

public function set Rtf (value : String)

属性值

RTF 格式的控件文本。

备注

可以使用此属性将 RTF 格式化文本放到控件中以进行显示,或用控件文本中定义的指定 RTF 格式设置提取控件文本。此属性通常用于将 RTF 文本从另一个 RTF 源(如 Microsoft Word 或 Windows 写字板)分配到控件时。

如果在运行时更改 RightToLeft 属性,则仅保留未经过格式设置的原始文本。

有关 RTF 代码,请参见位于 https://www.microsoft.com/china/msdn/library. 上的 MSDN Library 中的“rich text format (RTF) Specification, version 1.6”(RTF 格式规范,1.6 版)。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

RichTextBox 类
RichTextBox 成员
System.Windows.Forms 命名空间
Text