1

My project has a class with several methods, and many of the methods are overloaded. To access any specific method in my large class, I have to scroll for an unusually long time. The class is so big, sometimes finding a particular method can be difficult. I would like to be able to collapse (or fold) some of the methods, so that it is easier to work inside of my class.I was thinking about #region but, I will need to have one for each of my methods.

How can I collapse (fold) my methods?

JΛYDΞV
  • 8,532
  • 3
  • 51
  • 77
Adrien Neveu
  • 827
  • 1
  • 15
  • 28
  • try this answer http://stackoverflow.com/questions/982677/visual-studio-command-to-collapse-all-sections-of-code?rq=1 – Amitd Feb 16 '14 at 14:17
  • I saw this answer, but I wanted it to be by default, like regions. Also these commands will collapse my namespace. I took the screen above by going to the definition of the string class, and all methods were collapsed by default. – Adrien Neveu Feb 16 '14 at 14:21

1 Answers1

3

I think that there isn't a default setting that can do that, although I might be mistaken. There is a shortcut you can use in VS2008, not sure if it will work on 2012, but you might give it a shot.

  • Ctrl + M + O - collapse all

  • Ctrl + M + L - expand all

  • Ctrl + M + P - expand all and disable outlining

  • Ctrl + M + M - collapse/expand the current section

Dragan Okanovic
  • 7,509
  • 3
  • 32
  • 48
fabric1601
  • 91
  • 1
  • 8