Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio auto opening collapsed properties

Here is my problem. I have a C# class file loaded in Visual Studio that I am working on. I made a class and created some properties inside of said class. I collapsed the properties like so:enter image description here

I collapse the properties with the little +/- button on the side of each. I want to collapse each of them since I have a lot of other classes with properties and I don't want to see a lot of repetitive code (get, set).

Closing them works fine but after I work on some other classes in the same file the properties re-open so I can see the code:

enter image description here

This happens relatively often and is quite annoying. I have a lot of lines in the file and I sometimes have to work with a small screen. Is this a glitch/bug or something else? (I am using Visual Studio 2010 C# Express)

Thanks for your help.

like image 998
matthewr Avatar asked Nov 04 '22 17:11

matthewr


1 Answers

There is no way to solve this so far, but this does the trick. Press CTRL-M and then O and it will auto collapse everything in the current file you are on.

like image 72
matthewr Avatar answered Nov 12 '22 19:11

matthewr