开发者

visualstudio 2010 VB.NET customizing the code automatically displayed when I write New

开发者 https://www.devze.com 2023-01-17 17:11 出处:网络
When in a code edit开发者_StackOverflow社区or I write Sub New (enter) The editor automatically inserts:

When in a code edit开发者_StackOverflow社区or I write

Sub New (enter)

The editor automatically inserts:

Sub New()

    ' This call is required by the designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.

End Sub

How can I customize the code it writes? Can't find it in the code snippets manager.


This string is baked into Common7\IDE\1033\msvb7ui.dll. In other words, it is hard-coded in the binary code that implements the VB.NET IDE.

This is also the case for the auto-generated code when you implement IDisposable. Much worse actually since that code is inappropriate 99.9% of the time.

If it really annoys you, you could use File + Open + File and navigate to the DLL. Open the string table and double-click "String Table". It is string #1059. Note that you cannot change the line spacing or the comment. Do make sure you make a backup of the file, I didn't try it myself.

0

精彩评论

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