Computing.Net > Forums > Programming > Syntax highlighting in C#??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Syntax highlighting in C#??

Reply to Message Icon

Name: El-Trucha
Date: April 30, 2005 at 23:44:50 Pacific
OS: Windows XP SP2
CPU/Ram: 2.8 GHz/448 MB
Comment:

Hello every1!! :D
OK, what I need now is to make a text editor for a programming language (which I'm not telling so nobody copies me... :P ) in a RichTextBox in C#...
How do I do this?? I want to, for example, highlight if statements with blue...
How do I do this??
Thanx!!! ;)

El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: May 1, 2005 at 09:58:22 Pacific
Reply:

Look up Find, SelStart and SelLength and SelColor in the RichText Help files.

Find returns the starting location of the If statement. SelStart takes the value of find and SelLength takes the length of the item to highlight, in this Case 2. Then use SelColor to set the colour. Repeat as many times as necessary.

Stuart


0

Response Number 2
Name: El-Trucha
Date: May 1, 2005 at 13:28:17 Pacific
Reply:

Well...I searched both Google and MSDN and I found out that all of those are only for VB...I was thinking of C#... :P
Thanx!! ;)

El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx


0

Response Number 3
Name: borelli35
Date: May 2, 2005 at 14:24:39 Pacific
Reply:

====================================================================
Actually, since the richedit box is a Microsoft component that is completly independent of programming languages, you can use the methods mentioned by Stuart.

borelli35


0

Response Number 4
Name: El-Trucha
Date: May 2, 2005 at 14:50:57 Pacific
Reply:

But in what class are the methods in then?? They're not in the System.Windows.Forms.RichTextBox class...
Thanx!! ;)

El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Syntax highlighting in C#??

syntax highlighting in VC++ 7 www.computing.net/answers/programming/syntax-highlighting-in-vc-7/2343.html

URL-highlighting TextBoxes in C#? www.computing.net/answers/programming/urlhighlighting-textboxes-in-c/12814.html

help me in C++ www.computing.net/answers/programming/help-me-in-c/2812.html