Hi Everyone,
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,
Yuvjeeth
yuvjeeth
0
Newbie Poster
Recommended Answers
Jump to PostI 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
TheApex
5
Light Poster
yuvjeeth
0
Newbie Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.