How can I navigate to the next or previous procedu

2019-06-12 22:16发布

问题:

In VB6 you can easily go to next procedure by pressing CTRL+Page Down and also previous procedure by pressing CTRL+Page Up.

However I can't find any way to do that using Visual Studio 2010 programming VB.NET; I want to scroll down or up to go to the previous or next procedure using a keyboard shortcut.

回答1:

Yes, keybindings do exist and you're in luck; the keybindings below relate to Visual Studio 2010's Visual Basic.

It's come to my attention that these default keybindings aren't available in some installations of Visual Studio. If this is the case for you then proceed with the key-binding instructions below this section.

Visual Studio 2005, 2008, 2010

  • Next Method or Type: CTRL + or CTRL + PAGE DOWN
  • Previous Method or Type: CTRL + or CTRL + PAGE UP

All keybindings for Visual Studio 2010's Visual Basic can be found here, and more keybindings for other programming languages in Visual Studio can be found here

Same keybindings for other versions:

Visual Studio 2012, 2013, and 2015 (and any other version without the default keybindings)

Visual Studio 2012/2013/2015 Does not appear to have any Edit.NextMethod or Edit.PreviousMethod keybindings and the same behaviour can be observed for some installations of other Visual Studio versions, instead you'll have to assign your own:

  • TOOLS >> OPTIONS >> ENVIRONMENT >> KEYBOARD >> Select Visual Basic 6 from the Apply the following keyboard mapping scheme dropdown:

  • Find Edit.NextMethod and Edit.PreviousMethod in the Commands box:

  • Click within the Press Shortcut Keys box and press the shortcut keys you want to assign on the keyboard. In this case, let's copy the shortcut keys from Visual Studio 2010:

  • Once you've done that, click Assign and then do the same for the other command; the shortcut keys will now work

The Default key-binding is slightly misleading; it only applies if you open a file with Visual Studio that is not supported by the IDE, therefore you should be careful that you do not add a keybinding under this.