Did you know… You can press Ctrl+, D to view the Code Definition Window – #354


Now before I get the angry emails on my first day back from vacation, I will say up front that there is no love for VB in today’s tip. This is just for C#. As a VB developer from my SDET days, I feel your pain and encourage you to vote for this functionality in VB on the Connect site. If someone finds an open bug, let me know and I’ll post it here.

In the General Development Settings, the keyboard shortcut for the Code Definition Window is Ctrl+\, D. The command is View.CodeDefinitionWindow, in case your keyboard bindings differ.

Code Definition Window

Instead of doing an Edit.GoToDefinition, the Code Definition Window does it for you. Whenever you are on an object, the Code Definition Window will automatically update to show the definition. Kinda cool, huh? (even though the VB developers are grinding their teeth right now.)

Technorati Tags: VS2005Tip,VS2008Tip

Comments (13)

  1. Cosmin says:

    I know I’m off topic with this reply, but I did replied in the right place some time ago:

    I have a really annoying problem with my Visual Studio ctrl+tab window that somehow get stuck (I’ve tried to enable/disable the sticky keys several times without any result).

    Please help me with this problem (you are my last hope 😉 ), Thanks a lot!

  2. Wow! Great tip!

    Using Ctrl+ is not such a good idea though: Not international aware. On my belgian-french keyboard, is Ctrl+Alt+<. So how do I type Ctrl+ ? Fortunately, it’s easy to remap the tool.

  3. mos says:

    *ahem*

    It works just fine (usually) for C++, too.

  4. jemiller says:

    Is there a way to make it display the source code for .NET Framework classes also? i.e. not just the declarations, but, the source code itself. I know you can debug into it if you change some settings, but, goto definition doesn’t work.

  5. Kevin Dente says:

    Dang, I never knew about the Code Definition window. Thanks!

  6. orcmid says:

    Says it all.  I know, I know, C/C++ is its own punishment and I still love the sense of simplicity and mastery I have with it.  (Not all the C++ cruft, the heart of it.)  But the Visual Studio support is a seriously-different fork.

  7. Bob Kaye says:

    Great tip…but the Code Defintion window comes up in illegible colors….couldn’t find a setting in Tools | Options | Fonts & Colors to change them…any suggestions….?

    Thanks….

  8. Chris Nahr says:

    I never knew about the Code Definition window either… thanks!

  9. Mark Kola says:

    Awesome tip here. I keep forgetting that.

  10. Ricardo Villamil says:

    Awesome tip, I’m always using Go to definition!!

    Thanks Sara!!!

  11. John Neumeyer says:

    I never understood what the purpose of the Code Definition Window is?

  12. rtpHarry says:

    Does this work in VWD2008? It seems to fail but I am just wondering if there is an i18n issue…

    On a UK keyboard and press ctrl-[key to the left of Z] then D.

  13. Sunil says:

    We can also use F12 to go to the definition of a function.