开发者

Visual Studio 2010 shortcut to find classes and methods?

Is there any shortcut in Visual studio 2010 to find classes/interfaces?

I was using Resharper few years back to do that. Here now, I don't have the Resharper and looking something similar in Visual studio 开发者_开发问答2010 which can help me do that.

Right now, I have to use find all "s classname" that's closest I can get.


Visual Studio 2010 has the "Navigate To" command, which might be what you are looking for. The default keyboard shortcut is CTRL + ,. Here is an overview of some of the options for navigating in Visual Studio 2010.


Ctrl+T in Visual Studio 2017.


Try Alt+F12 in Visual Studio 2010.

It opens up the Find Symbol dialogue which allows you to search for methods, classes, etc.


Use the "Go To Find Combo Box" with the ">of" command. CTRL+/ or CTRL+D are the standard hotkeys.

For example, go to the combo box (CTRL+/) and type: >of MyClassName. As you type, intellisense will refine the options in the dropdown.

In my experience, this is faster than Navigate To and doesn't bring up another dialog to deal with. Also, this combo box has a lot of other nifty little shortcut commands:

Using the Go To Find Combo Box

This textbox used to be the default on the Standard toolbar in Visual Studio. It was removed in Visual Studio 2012, so you have to add it back using menu ToolsCustomize. The hotkeys may have changed too: I'm not sure since mine are all customized.


In VS 2022, and I assume also in older versions, you may have to check the shortcuts for finding classes/types. In my case I had to manually configure the shortcut in Tools->Options->Keyboard:

Visual Studio 2010 shortcut to find classes and methods?

This is very similar to the ReSharper "Ctrl + T" command, which I have used more often.


Left click on a method and press the F12 key to Go To Definition. Other Actions also available


"Control + ," you will get a search textbox enter your text it will automictic show all.


Ctrl+K,Ctrl+R opens the Object Browser in Visual Studio 2010. Find what you're looking for by searching and browsing and filtering the results. See also Ctrl+Alt+J. ^K ^R is better because it puts your caret right in the search box, ready to type your new search, even when the Object Browser is already open.

Set the Browse list on the top left to where you want to look to get started. From there you can use the search box (2nd text box from the top, goes all the way across the Object Browser window) or you can just go through everything from the tree on the left. Searches are temporary but the "selected components" set by the Browse list persists. Set a custom set with the little "..." button just to the right of the list.

Objects, packages, namespaces, types, etc. on the left; fields, methods, constants, etc. on the top right, docstrings on the lower right.

The display mode of a pane can be changed by right-clicking in the empty space of the window; tree organized by assembly/container or by namespace and other preferences.

Items can be right-clicked to find, copy and filter.

For keyboard navigation, use Ctrl+K,Ctrl+R from anywhere to start a new search, Enter to execute the search you just typed or pasted and Ctrl+F6 to make the Object Browser close. ALT+<-- to go back and ALT+--> to go forward through the search history. More can be set; search for "ObjectBrowser" in the keyboard shortcut config.

If the key shortcuts above don't work, Object Browser should be in the View menu somewhere with a different shortcut. If all else fails, search for "ObjectBrowser" under Tools->Options->Environment->Keyboard->"Show commands containing".


try: ctrl + P

type: @

followed by the name of the class,method or variable name you search for.


In Visual Studio Code, the default shortcut for this is Ctrl + P.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜