Tips and Tricks for getting the most out of Visual Studio 2005 from my VDNUG and ADNUG sessions


Well I must admit that I learnt a lot getting this session together and as promised here is a summary of stuff that’ll save you time and money!!


Oh and my admission, I borrowed, ok I stole a lot of the ideas from Anson Horton’s “PDC Tips and Tricks” session and his blog, thanks Anson, yup he does know!! 🙂


Check out his blog and the link to the video stream of his PDC session


Oh and Check out Bill McCathy’s snippet edit here!!


So as requested these are some of the tips and tricks


Stepping through the “Go To Definition” History Stack


This is not very discoverable and it’s definitely my favourite!!


Backward: Ctrl Shift *
Forwards: Ctrl Shift &


Navigating through the Edit History Stack


Backwards: Ctrl –
Forwards: Ctrl Shift –


Navigating Windows


Class Pane: Ctrl W C (W=Window, C = Class)
Property Pane: Ctrl W P (W=Window, P=Property)
Solution Pane: Ctrl W S (W=Window, S=Solution)


Outlining


Collapse All: Ctrl M O
Expand All: Ctrl M P
Toggle region: Ctrl M M


Refactoring


Shortcut key: Ctrl . (This works when you make a change to a declaration, a little red squiggle appears under the change, you can activate the refactoring it with the mouse or Ctrl . which is much faster!!)
 


Code Snippets


Activate a snippet by typing it’s name followed by the Tab key. 


By default the C# snippets are installed in the the C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C# directory, the VB snippets are C:\Program Files\Microsoft Visual Studio 8\VB\Snippets\1033. 


Check them out, they are a pretty simple XML docs!!


If you make changes then the ideal place to save them is your My Documents\Visual Studio 2005\Code Snippets directory under the appropriate language section.


Debugging Attributes


Two really useful attributes that you can use to control the output of the debug variable watch window, cut down on clutter and see what you are really interested in.


You need to include the “System.Diagnostics” namespace and the two attributes are [DebuggerBrowsable(..)] and [DebuggerDisplay(..)]


see Anson’s blog at http://blogs.msdn.com/ansonh/archive/2005/12/06/500823.aspx and


Tip#23: Stepping behavior customization


and


Tip#24: Value column customization


Cheers and enjoy, Dave

Comments (9)

  1. Mike says:

    Ctrl Shift * doesn’t work for me. Is there a specific keyboard scheme I need to have enabled? Maybe not VB

  2. Paul Turner says:

    Don’t forget the Ctrl+K then Ctrl+D to reformat the code (alignment, tabs and spaces etc…)

  3. Dave Glover says:

    Hi there Mike, I’ll check what the key code for VB is!!  Cheers, Dave

  4. DanH says:

    You forgot the most important tip.

    http://www.jetbrains.com/resharper/

    Makes VS almost usable.

  5. lb says:

    Top stuff Dave!