Question

Superfluous qualifier: This is probably a silly question, but...

Using VB.NET and / or C#:
Is there a way to jump to a region quickly, similar to the way you can choose a class and find functions / methods / events from drop-down lists? I have organized thousands of lines of code into neat regions but it seems like a waste if I can't find them quickly.

I now realize Ctrl-M + O (outlining) will basically give me what I was looking for, but the question stands.

Update: Since the community and myself can't seem to find a way to do this, the answer to my question is: No, there is no way to do this. With this knowledge, I won't be so concerned with regions in the future as their usefulness is limited.

Update 2: This question originally applied to VS2010. However it seems to be applicable to later versions as well. At least in 2015, it seems you can quickly jump between regions using keyboard shortcuts.

Relevant Question: VS 2015 shortcut for "GoTo Region" #region / #endregion

Was it helpful?

Solution

Depending on how your code is wrapped in #regions you can use the built-in feature to Collapse to Definition Ctrl + M , O. Then navigate to the region you want. You can undo the collapse by using Ctrl + M , P

OTHER TIPS

You can create bookmarks in Visual Studio 2010. Nice article here - http://www.codeproject.com/Articles/42973/Using-Bookmark-in-Visual-Studio

You can try the extension CodeNav that let you see also the code regions on the left pane.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top