Visual Studio .NET Tips & Tricks

Helpful information for Visual Studio .NET developers

Archive for the ‘Advanced’ Category

Tip: VS.NET Add-ins

Posted by Ion Toma on April 17, 2006

VS.NET can be adapted and extended to automate the development process (like repetitive tasks) or to provide functionality that is missing (development tools, etc). The development environment can be extended using macros or add-ins. What is nice is that most of the add-ins are free to download and use.

Example: We can use GhostDoc, a free add-in for Visual Studio, to automatically generate XML documentation comments. GhostDoc is looking at the information in base classes or implemented interfaces. Also, it can generate the comments based on then ame and type of methods, properties or parameters. 

1. Before using GhostDoc
void checkLogin( string strUsername, string strPassword){
}

2. After installing GhostDoc, right-click on the method declaration and choose “Document this”. The following comments are generated:
/// <summary>
/// Checks the login.
/// </summary>
/// <param name="strUsername">The username.</param>
/// <param name="strPassword">The password.</param>
void checkLogin( string strUsername, string strPassword){
}

In this example, GhostDoc has automatically generated the documentation for our method based on the name of the method and the name of the parameters. Basically, it gives a starting point, we can easy add more information.

Note: a nice article can be found at http://msdn.microsoft.com/msdnmag/issues/05/12/VisualStudioAddins/, it is called "Visual Studio Add-Ins Every Developer Should Download Now"

Flash Demonstration

Posted in Add-ins/Plugins, Advanced, Miscellaneous, VS.NET 2003, VS.NET 2005 | 1 Comment »

Tip: Most useful shortcuts in VS.NET

Posted by Ion Toma on April 17, 2006

Switching between Windows:

Ctrl+F6  – navigate between various panes that appear in the base code editing window.
Shift+Alt+Enter – full-screen mode at any time. In full-screen mode, only the active window is visible in full screen.
Alt+F6/Alt +Shift+F6 – move cursor away from the main editing section into docked windows like Properties, Help, Dynamic help, Server Explorer (if these winows are open).
F7 – Jump to Code Behind/Base Code editing window

Editing:
Ctrl+Shift+V   – cycle through the clipboard ring.
Ctrl+- (Ctrl + Hyphen) – similar with Internet Explorer, very easy to navigate from page to page.
Ctrl+Shift+- – cycles in the opposite direction.
Block Selection: – press Alt and then select the area you want with your mouse.
Line No in Code – Tools>Options>Text Editor>All Languages>General>Line numbers.
Ctrl+] :matching brace/comment/region/quote
F4: Property Window
Ctrl+Alt+L – Solution Explorer
Ctrl+Alt+O – Output Window
Ctrl+Alt+K – Task List
Ctrl+Shift+Space – intellisense window.
Ctrl+R – Word Wrap

BookMark:
Ctrl+K, Ctrl+K – Create/Remove Bookmark
Ctrl+K, Ctrl+N  – Move to next bookmark
Ctrl+K, Ctrl+P –  Move to previous bookmark
Ctrl+K, Ctrl+L – Clear all bookmarks

Code Format:
Ctrl+K, Ctrl+F – Auto-format selection
Ctrl+U – Convert to lower case
Ctrl+Shift+U – Convert to upper case
Ctrl+K, Ctrl+C – Comment selection
Ctrl+K, Ctrl+U – Uncomment selection

Code Outline:
Ctrl+M, Ctrl+M – Fold/Unfold the current code block
Ctrl+M, Ctrl+L – Unfold all
Ctrl+M, Ctrl+P – Stop outlining
Ctrl+M, Ctrl+O – Fold all

Running/Debugging:
F5 – Start Application in debug Mode
Ctrl+F5 – Start Without debugging
F11 – Step into
F10 – Step over.
Shift + F11 – Step Out.
Shift + F5 – Stop debugging.
Ctrl+Shift+F5 – Restart Debugging.

Posted in Advanced, Beginner, Coding & Debugging, Intermediate, Miscellaneous, VS.NET 2003, VS.NET 2005 | Leave a Comment »