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
  1. Home
  2. General Programming
  3. C#
  4. RTF - Codes

RTF - Codes

Scheduled Pinned Locked Moved C#
question
2 Posts 2 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.
  • M Offline
    M Offline
    Moon Boy
    wrote on last edited by
    #1

    Hi I tryed to use the RTF codes in RtfBox, doesnt work :( How can i bold a text in a RTFBox without the "SELECT Method"(Select the text, and the Selection Font and Color ) ? only \b doesnt work, appers a square :( Thanks.

    C 1 Reply Last reply
    0
    • M Moon Boy

      Hi I tryed to use the RTF codes in RtfBox, doesnt work :( How can i bold a text in a RTFBox without the "SELECT Method"(Select the text, and the Selection Font and Color ) ? only \b doesnt work, appers a square :( Thanks.

      C Offline
      C Offline
      Charlie Williams
      wrote on last edited by
      #2

      First off, you're getting the square because you're trying to set RTF codes using the Text property, which has no knowledge of RTF codes. (And you're not using the @ symbol in front of your string, so C# thinks "\b" is an escape character. Either make it a string literal or escape the backslash "\\b".) If you want direct access to the RTF codes in a RichTextBox, you should use the Rtf or SelectedRtf properties. However, I don't think that's what you're looking for, as it will make it quite a bit more difficult than using SelectionFont, SelectionColor, etc. The Rtf and SelectedRtf properties will give you the entire Rtf formatting string for the contents of the control or selection, respectively. There are intended more for pasting RTF from other sources. You can't use them to simply turn bold or color on or off. Charlie if(!curlies){ return; }

      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