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 highlighting

RichTextBox and highlighting

Scheduled Pinned Locked Moved C#
csharp
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.
  • P Offline
    P Offline
    Paolo Ponzano
    wrote on last edited by
    #1

    Hello, I just want to know if it's possible to do sintax highlighting with .net richtextbox without extending that class. I've seen that there're two examples on codeproject but they extend the dll, and I can't. Thanks you Bests, Paolo

    M 1 Reply Last reply
    0
    • P Paolo Ponzano

      Hello, I just want to know if it's possible to do sintax highlighting with .net richtextbox without extending that class. I've seen that there're two examples on codeproject but they extend the dll, and I can't. Thanks you Bests, Paolo

      M Offline
      M Offline
      mikanu
      wrote on last edited by
      #2

      I've done quite some work with the richTextBox control that was included with .NET 2003 (so this comment doesn't apply to the 2005 version) and I can tell you that it doesn't support syntax highlighting by itself. Actually the .NET component is actually a wrapper for the good old COM-based pre-.NET RichEdit32 control. Those being said, what you could do is you could use the text changed event of the control and create your own interpretation class that you could feed the content of the control. The interpretaion class would then run through the text and *interpret* (that is, set formatting options for certain areas of the text) and set the text property of the component to the *interpreted* text. This is a solution although it may become slow as the density of the text increases. You may consider optimizing it by making a *wise* run-thtough by examinig what type of changes the text suffered... Good luck!

      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