Is there a shortcut to move between header and source file in VC++?

后端 未结 16 897
长发绾君心
长发绾君心 2020-12-04 08:07

This is a feature I have grown accustomed to in Eclipse (Ctrl+Tab). Is there an equivalent in Visual C++?

相关标签:
16条回答
  • 2020-12-04 08:32

    Try using Switch - it's an addin that lets you flick between source and header, code and designer, XAML and codebehind etc etc:

    http://www.dwmkerr.com/switch/ or directly from Products and Extensions for Visual Studio

    0 讨论(0)
  • 2020-12-04 08:34

    For Visual Studio 2013, as mentioned by others it's the command named:

    EditorContextMenus.CodeWindow.ToggleHeaderCodeFile
    

    and it has as default combination of keys: Ctrl+K,Ctrl+O, but it can be changed if you introduce the new combination of keys that you like in the

    Press shortcut keys:

    under

    Tools -> Options -> Environment -> Keyboard.

    So you can choose a custom keys combination as my favorite for .h to .cpp switch is Ctrl+Tab.

    0 讨论(0)
  • 2020-12-04 08:35

    In Visual Studio 2008 and 2010, you can right click in your .cpp file and choose Go To Header File ... that will take you in one direction. For the other direction, if you right click something you're declaring in the header, and choose Go To Definition, that will take you in the other direction. You might have to go through an ambiguity resolution dialog if you choose the constructor, because the function name matches the class name, but if you choose anything else, you'll go straight where you want. I know this is a two-click approach, rather than one keystroke, but it does do what you want.

    0 讨论(0)
  • 2020-12-04 08:36

    In Visual Studio 2013 a default keyboard shortcut for this is Ctrl+K, Ctrl+O

    0 讨论(0)
提交回复
热议问题