views:

17

answers:

1

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.

A: 

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.

jvenema
He's looking for a pretty-printer.
SLaks
That's an interesting link, but it doesn't do the wrapping and indenting of the If/Then/Else statement (and other statements). I do like the link though, and I"ll put it to use.
Jeff