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. richTextBox and rtf problem

richTextBox and rtf problem

Scheduled Pinned Locked Moved C#
csharpquestionvisual-studiojsonhelp
1 Posts 1 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.
  • P Offline
    P Offline
    panoskatws
    wrote on last edited by
    #1

    Hello all, I'm having some trouble with richTextBox. Using c# in Visual Studio 05. What I do first is to copy the control code ({\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard) in a string, and then the text I need from an rtf file (\f0This is some {\b bold} text.\par) in another string and combine them, I do this for loading specific lines of the file... Anyway, the problem is that when I load this in a richTextBox (rtb.Rtf = myString;), I noticed that the control code is changed. For example if the control code cotains code for 5 fontsyles in its fontable ({\f0\fnil\fcharset161 Microsoft Sans Serif;}{\f1\fnil\fcharset0 Tahoma;}{\f2\fnil\fcharset0 Arial;}{\f3\fnil\fcharset0 Arial Black;}{\f4\fnil\fcharset0 Arial Narrow;}), if the text uses only 3 of them the rest two are not included in the control code of the richTextBox ({\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Arial Black;}{\f2\fnil\fcharset0 Arial Narrow;}). I hope you understand what my problem is. Is there a way of avoiding this to happen, or, if not, how can I control this so when I need to make some changes in the fontstyle of the text, the file will be updated with no mistakes (like f1 is "Tahoma" and not "Arial Black")?

    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