Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Formatting inside Rich Text Box

Formatting inside Rich Text Box

Scheduled Pinned Locked Moved C#
htmlhelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raj231362
    wrote on last edited by
    #1

    Formatting inside Rich Text Box Is there a way I can make certain sections of text formatted in a rich text box? Like parts of it are bold, underlined, different sizes or colors, all in the same Rich Text Box. I'm making a program that will use an HTML view and a Standard view, and I have no way to format the standard view. So, in the HTML view, it would show "This is bold. This is Italic.", but in the standard view it would show "This is bold. This is Italic." Help me??

    L S 2 Replies Last reply
    0
    • R raj231362

      Formatting inside Rich Text Box Is there a way I can make certain sections of text formatted in a rich text box? Like parts of it are bold, underlined, different sizes or colors, all in the same Rich Text Box. I'm making a program that will use an HTML view and a Standard view, and I have no way to format the standard view. So, in the HTML view, it would show "This is bold. This is Italic.", but in the standard view it would show "This is bold. This is Italic." Help me??

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, that is a basic but endless question. Formatting is what makes the RichTextBox different from a regular TextBox. Hence the answer is contained in the documentation on RichTectBox (read all of it), and in the many articles (CodeProject and other) on the subject. Google is your friend. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Fixturized forever. :confused:


      modified on Saturday, November 8, 2008 9:15 AM

      1 Reply Last reply
      0
      • R raj231362

        Formatting inside Rich Text Box Is there a way I can make certain sections of text formatted in a rich text box? Like parts of it are bold, underlined, different sizes or colors, all in the same Rich Text Box. I'm making a program that will use an HTML view and a Standard view, and I have no way to format the standard view. So, in the HTML view, it would show "This is bold. This is Italic.", but in the standard view it would show "This is bold. This is Italic." Help me??

        S Offline
        S Offline
        sph3rex
        wrote on last edited by
        #3

        You can make custom formatting by using RichTextBox.Select(int index, int lengthofselection) and after applying formatting to selection like RichTextBox.SelectionFont = "......", then calling RichTextBox.DeselectAll() and repeating the cycle. This still is kindda lame ... i would suggest looking at rtf's file format and make the formatting yourself or search for a class that does that.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups