I would like to know if there is any way to change the color of a part of text in rich textbox when the user types it automatically like the way in vb.net IDE (Classes have blue etc.).
Thanks in advance,
Jump to Post
I guess you're talking about Syntax Highlighting. You need to select that part of text by using SelectionStart & SelectionLength (from RichTextBox) and then, change it's color with SelectionColor.
As an example, this code makes the first 10 characters blue:
richTextBox1.SelectionStart = 0; richTextBox1.SelectionLength = 10; richTextBox1.SelectionColor …
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.