Generate Method Stubs using Shortcut Key in Visual Studio

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 !

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

3 Comments to “Generate Method Stubs using Shortcut Key in Visual Studio”

Comments are closed.