locked
Keyboard shortcuts for Find - Toggle between Code behind and Markup view

    Question

  • I looking for a key combination or a shortcut key (like F7) for swiching between Code behind view and Markup view, bypassing the Design view, because I rarely use it.

    Its realy annoying after pressing F7 from Code behind view, to wait all the visual controls to be built just to be able to switch to Markup.

     

    Thanks in advance for any suggestions.

    Bojidar

    Wednesday, September 20, 2006 9:50 AM

Answers

  • There isn't one by default, but it's possible to write a macro and then bind a keyboard shortcut to it.  This macro posted on codeproject comes close: .  I modified it slightly to do exactly what you're looking for (though it makes the macro work only for C#):

    Code sample

    Change the line:
        OpenCodeBehindFile(activeDoc)
    to:
      OpenCodeBehindFile(activeDoc & ".cs")

    Change the line in OpenCodeBehindFile from:
      projItem.Open(Constants.vsViewKindCode)
    to:
      projItem.Open(Constants.vsViewKindCode).Activate()

    Wednesday, September 20, 2006 11:18 AM

All replies

  • There isn't one by default, but it's possible to write a macro and then bind a keyboard shortcut to it.  This macro posted on codeproject comes close: .  I modified it slightly to do exactly what you're looking for (though it makes the macro work only for C#):

    Code sample

    Change the line:
        OpenCodeBehindFile(activeDoc)
    to:
      OpenCodeBehindFile(activeDoc & ".cs")

    Change the line in OpenCodeBehindFile from:
      projItem.Open(Constants.vsViewKindCode)
    to:
      projItem.Open(Constants.vsViewKindCode).Activate()

    Wednesday, September 20, 2006 11:18 AM
  • Thanks a lot mate, it works like a charm now! 

    P.S.: I couldn't mark your reply as an Answer because of this:

    Unknown Error
      We apologize, but an unknown error has occured in the forums.

    This error has been logged.

    Wednesday, September 20, 2006 12:09 PM