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, manipulating RTF directly

RichTextBox, manipulating RTF directly

Scheduled Pinned Locked Moved C#
jsonquestionlounge
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.
  • D Offline
    D Offline
    Daniel Monzert
    wrote on last edited by
    #1

    Hi there. In order to create a class for a chat application - like readonly textbox that inherits the System.Windows.Forms.RichTextBox, I am trying to use a predefined color table (IRC-like textbox) in the RTF code. {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Fixedsys;}} {\colortbl ;\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue139;\red0\green100\blue0;\red255\green0\blue0;\red128\green0\blue0;\red128\green0\blue128;\red255\green165\blue0;\red255\green255\blue0;\red144\green238\blue144;\red95\green158\blue160;\red0\green255\blue255;\red0\green0\blue255;\red255\green192\blue203;\red169\green169\blue169;} "\viewkind4\uc\pard\f1\highlight1\cf2 This line uses the first color as foreground- and the second color as background-color on this line\par \highlight0\cf0 This line uses default colors.} After I set the new RichText (control.RTF = variable), the RichTextBox automatically reformats the raw rich text I manipulated just a few ticks ago. It removes all not yet used colors from the colortable and even reorders it. Is there a way to override/avoid automatic reformatting of the raw richtext (control.RTF)? I don't want to use the techinque where the last added text is selected, some forecolor applied, via API some background color applied, ... Daniel

    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