Automatically inserting method & function headers from an interface that are being implemented with

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

When implementing an interface in VB.NET using Visual Studio .NET 2005, it
would be nice if I could have the method/function headers inserted
automatically. Whenever we implement an event (such as Button.Click,
TextBox.TextChanged, etc.), all we have to do is select the control and
event from the dropdownlists at the top of the editor. Obviously the
interfaces (IPostBackDataHandler, ICallbackEventHandler, etc.) are not
listed there, but because some of the interfaces are used rather often and
the headers must match the ones defined in the interfaces, I would think
Visual Studio .NET 2005 would have a way to insert them. Is there a way to
do this? If so, what is it? Thanks.
 
Check the code snippets and see if there are any to do what
you are talking about. If not, you can create your own using
the Code Snippet editor.

To see the code snippets, type ? and hit <Tab> in the code
editor. YOu will get a menu showing a list of types of
snippets -- just drill down and see if you find one you like.
If you do, just select it and the code snippet will be
inserted.

Note that if you select with the up/down arrows, or hold
your mouse over the description of the actual snippet,
it shows a "shortcut". If you type this shortcut into
the code editor and hit <Tab>, it will insert the code
for you. For example, property is the shortcut for a
property.

Here's the link to a code snippet editor you
can use to create your own snippets. You can export
them and make them available to other developers
if you wish.

http://msdn2.microsoft.com/en-us/vbasic/ms789085.aspx

Good luck.
Robin S.
 
Back
Top