I think that there's something in the VB.NET CodeBank forum that can do that in a RichTextBox. I think it's entitled "Fast Syntax Highlighting" or the like, although I'm not sure.
Alternatively, I think that the code editor from SharpDevelop can be used on its own. SharpDevelop is open-source so, at the least, you may well be able to use the same code as long as you abide by the license conditions.
It has various color schemes and I believe one is highlighting different languages in the same solution. I like having the lines linking indented code on:
It has various color schemes and I believe one is highlighting different languages in the same solution. I like having the lines linking indented code on:
I don't understand what the VB PowerPacks have to do with the question. Have you linked to the wrong thing?
VB PowerPacks has the colored tabs by language. It may not work for the OP as asked but I didn't see any harm in posting it.
Either I'm missing something here or you are. VB PowerPacks is a group of Windows Forms components including shapes like LineShape, DataRepeater and PrintForm. It has nothing to do with colouring text, as far as I'm aware. I have no idea what you're referring to. If I'm wrong then I'm keen to find out what exactly you mean, but I think that you must be thinking of something other than VB PowerPacks. Did you maybe mean PowerTools?
That's an add-in for VS. My impression was that the OP was looking for a control they could add to their own application that would allow them to colour syntax at run time, not something to colour syntax in VS when they're building the app. Maybe I misinterpreted it.
Hi,
I have done this with VB6 and can post the Code for -ColorizeWords-,
you would have to convert it to .net
let me know if you want it.
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
I'd expect that VB.NET code would significantly different enough that a conversion would be more work than it was worth.
Hi Jmc,
yes your right, just went threw the Links, everything is there
to get started.
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
Here's the skinny as far as I know it: you don't want to try writing it yourself.
There are plenty of decent examples for making a RichTextBox do this. It takes some not-obvious magic to make it perform reasonably well. RichTextBox wasn't really made for that kind of on-the-fly formatting, but if you do tricks like "only format the visible areas" or "try to do some parsing work in the background" you can get pretty far.
If you try to do it yourself the most obvious way, it's going to be too slow once you hit about 100 lines. The stuff JMC linked is going to be your best bet.
Another option might be to see if SharpDevelop has still published their editor. It was the syntax-highlighting editor behind the SharpDevelop IDE for years, and available as Open-Source. Heck, at one point they had a free e-book published about how they implemented it, I'm ashamed I didn't have the attention span to finish it but I was like, 19 and still too green to grasp it.
I'm pretty sure SharpDevelop moved on to a WPF-based editor, those are nice because the text rendering engine in WPF gives you a lot more power as the programmer. To some extent you can treat every letter in the control as if it were an individual Label, which is very convenient for almost everything you want to do in an IDE.
I think there's a second WPF editor but I have a feeling it's just the new SharpDevelop one with a different "brand".
This answer is wrong. You should be using TableAdapter and Dictionaries instead.