Export (0) Print
Expand All
Expand Minimize
4 out of 22 rated this helpful - Rate this topic

Code: Formatting Characters in Bold in a RichTextBox Control (Visual C#)

Visual Studio .NET 2003

This example adds the text "This text is in bold." to an existing RichTextBox control.

Example

richTextBox1.Rtf = @"{\rtf1\ansi This is in \b bold\b0.}";

Compiling the Code

This example requires:

  • A RichTextBox control named richTextBox1.

Robust Programming

The rich text format is extremely flexible, but any errors in the format lead to errors in the displayed text. For more information, see Rich Text Format (RTF) Specification, version 1.6.

See Also

Windows Forms Example Topics | RichTextBox Control (Windows Forms)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.