Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Best way to do syntax highlighting

This topic is 5303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

what's the best way to go about highlighting C# keywords in a rich text box? Changing the ForeColor of the rich text box changes all the text, not certain words so I was thinking that each time a word is typed it would be added to an ArrayList. I could then write the elements in the ArrayList one by one after after checking if it was a keyword or not and if so change the text color of that word. Actually come to think of it, that idea wouldn't work either because how could I change the color of each word individually. Not to mention being highly inefficent. Anyone got any better ideas?
// I mean something like this, notice how certain words are highlighted.


while (true)
{
    /* Do stuff. */
}

public bool f(int i, char c)
{
     // ...

     return true;
} 
[edited by - template on November 13, 2003 9:32:47 PM]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!