CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    G day Mayt Land
    Posts
    971

    [RESOLVED] RichEdit & text type

    I am not sure if this control woudl allow me to display various Text types (BOLD , Normal , Italic ) in one control .

    If it does not , do you know of any man made control that can do that?

    Cheers

  2. #2
    Join Date
    May 1999
    Location
    G day Mayt Land
    Posts
    971

    Re: RichEdit & text type

    Solution:

    richTextBox1.Rtf = @"{\rtf1\ansi This text is in \b bold\b0, " +
    @"this is in \i italics\i0, " +
    @"and this is \ul underlined\ul0.}";

    for those that may have the same problem

  3. #3
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: [RESOLVED] RichEdit & text type

    You could also do this:

    Code:
             Font font = new Font("Arial", 10, FontStyle.Bold);
             richTextBox1.SelectionFont = font;
             richTextBox1.AppendText("This is bold");
    Fontstyle is an enumeration where can choose between regular, bold, italic, underline and strikeout.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured