Generate Method Stubs using Shortcut Key in Visual Studio

By | January 1, 2011

Ctrl + .” Or “ALT + SHIFT+F10”   is one of  the very useful shortcut key in Visual Studio. You can use that shortcut key to generate the methods stubs. Like, If you want to create method which will add to number, you can write like AddTwoNumber() and press “Ctrl+.” and Enter to generate the Stub for your methods automatically

3

 

4

 

The most interesting  point it will generate  the stubs based on the type of argument we are giving. As shown in below picture for first arguments its generated integer and for second its generated string.

5

 

also, this will work for return type as well.

image

Yes, this tip will surely speed up your coding.

You can use the same key for different purpose as well. Here is one of my blog post, which you may found interesting

One of my favorite Visual Studio Shortcut- Very useful !

3 thoughts on “Generate Method Stubs using Shortcut Key in Visual Studio

  1. Pingback: Tips from Daily .NET Tips – Week 1 « Abhijit's World of .NET

  2. Pingback: Tweets that mention Generate Method Stubs using Shortcut Key in Visual Studio | Daily .Net Tips -- Topsy.com

  3. Shankar

    Hi Abhi,

    These shortcuts are very helpful to reduce coding.. Thanks a lot…

Comments are closed.