开发者

Is There A Way To Apply CODE Formatting To A VB.Net TextBox?

开发者 https://www.devze.com 2023-01-01 04:25 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消