Is there a keyboard shortcut to move the cursor between methods in Visual Studio 2010?

Solution 1:

Note: For VS <2015, the following works only for the VB.NET code editor. In VS 2015+, apparently the C# code editor is also supported.

While there are no default keyboard bindings to jump between methods, you can set them up yourself:

Go to ToolsCustomize…, then Keyboard…, and do the following:

  1. Search for the commands by typing Method in the input line at the top.

  2. Locate the two commands Edit.NextMethod and Edit.PreviousMethod.

  3. For each of these, select the command first, then move the input focus to the input field Press shortcut keys, enter an unassigned key combination, and press the Assign button.

Options dialog where keyboard bindings can be set up and modified

(The screenshot above shows that I have previously assigned one of these commands to Ctrl+Shift+<.)

Solution 2:

Hi another (cheaper) alternative might be the CTRL+M+M to collapse/expand the current method to it's definition, allowing you to quickly navigate to the next. Also CTRL+M+O to collapse all members is useful, with CTRL+M+L to expand all again.

Solution 3:

Visual Studio doesn't have such a function, but JetBrains' ReSharper does. At least is the only one that I know of to offer this functionality.

For ReSharper the shortcuts are Alt-Up and Alt-Down, for previous/next member.

Solution 4:

Try CTRL + ALT + UP. This first takes you to the scope selector where you can select a class if applicable, then press TAB which takes you to the method selector where you can select a method from the selected scope.

Note I use In Visual Studio 2012, don't know if works in other versions.