HelpGetting Syntaxing to work in richtexttbox?

Posts 1–7 of 7 · Page 1 of 1
Getting Syntaxing to work in richtexttbox?
Never mind, request /close. Syntax highlighting using VB is far too CPU intensive and it takes ages to syntax it all on large xml files...
Quote Originally Posted by ||Excision|| View Post
Never mind, request /close. Syntax highlighting using VB is far too CPU intensive and it takes ages to syntax it all on large xml files...
Only if you do it incorrectly.
Post your code and maybe we can point out some ways to improve it.

You're maybe handling the strings wrong (making lots of new/copies?), or calling some function of the RichTextBox too often -- if you call some function of a gui control millions of times, it's going to take a long time. Hard to say w/o seeing how you did it..
I just completely removed it lol. It was some snippet I found on vbforums. It basically scanned richtextbox1 when a document was opened and changed the color of the strings, and when you typed on textchanged event it would do the same. It was really really slow when loading a 53 kb XML file, and it scrolled all over the place like crazy as you typed rescanning everything. It was not a good snippet at all LOL. I'm just not exactly sure on how to do the syntax color stuffs that wont make the program hang when loading a large file, or scroll all over when typing lol. Also sorry for the 3 day wait on a reply. I have been working like crazy and had no time to get on here
Quote Originally Posted by ||Excision|| View Post
I just completely removed it lol. It was some snippet I found on vbforums. It basically scanned richtextbox1 when a document was opened and changed the color of the strings, and when you typed on textchanged event it would do the same. It was really really slow when loading a 53 kb XML file, and it scrolled all over the place like crazy as you typed rescanning everything. It was not a good snippet at all LOL. I'm just not exactly sure on how to do the syntax color stuffs that wont make the program hang when loading a large file, or scroll all over when typing lol. Also sorry for the 3 day wait on a reply. I have been working like crazy and had no time to get on here
Scanning works fine (for that sample), however the snippet could be improved by only scanning X length near the text change.
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us