Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

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: ,
Posted: Tuesday, November 11, 2008 3:00 AM by saraford

Comments

Cosmin said:

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!

# November 11, 2008 10:40 AM

Serge Wautier said:

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.

# November 11, 2008 11:50 AM

mos said:

*ahem*

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

# November 11, 2008 11:52 AM

jemiller said:

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.

# November 11, 2008 12:26 PM

Kevin Dente said:

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

# November 11, 2008 12:26 PM

Dennis E. Hamilton said:

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.

# November 11, 2008 12:46 PM

Bob Kaye said:

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....

# November 11, 2008 5:57 PM

Chris Nahr said:

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

# November 12, 2008 3:38 AM

Mark Kola said:

Awesome tip here. I keep forgetting that.

# November 12, 2008 5:14 AM

Ricardo Villamil said:

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

Thanks Sara!!!

# November 12, 2008 10:50 AM

John Neumeyer said:

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

# November 13, 2008 8:20 AM

rtpHarry said:

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.

# November 13, 2008 10:34 AM

Sunil said:

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

# November 21, 2008 12:13 AM
New Comments to this post are disabled
Page view tracker