Jump to content
  • Advertisement

Archived

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

template

Best way to do syntax highlighting

This topic is 5393 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
moc.elgoog is your friend

http://www.c-sharpcorner.com/Code/2003/June/SyntaxHighlightInRichTextBoxP1.asp

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!