I'm playing with a simple string replacement editor for editing VB.Net functions outside of VB. Is there a way to apply VB.Net code开发者_运维知识库 formatting to a string?
For example. The txtboxCodeEntry looks like this:
If strVar="dummy" then 1 else 0 Endif
I would like it to "autoformat" to:
If strVar = "dummy" Then
1
Else
0
End If
The formatting would match whatever formatting VB.Net does when you're editing code in the Visual Studio IDE.
Thanks.
Check this out:
http://www.codeproject.com/KB/edit/SyntaxHighlighting.aspx
Also:
http://xtractpro.com/articles/CSharp-Syntax-Highlighter.aspx
if you want straight text highlighting. It's pretty basic but should do the job.
精彩评论