How to disable region collapsing or expand ALL regions in Visual Studio VB.NET?

In Visual Studio 2012 and 2013 there is an option for deactivating collapsing (called 'outlining mode').

You can find it under:

Text-Editor->Basic->VB Specific

and then uncheck "Enable outlining mode".

But you will then lose the feature for collapse/expand at all.


If you are willing to remove regions you can try this:

Ctrl+F

  • Quick Replace
  • Find Options
  • Use: Regular Expressions

Find What:

^\s*#(end)?region.*$

Replace with:

[leave replace box empty]

Explanation:

  • ^ - Match the start of a line
  • \s* - Match zero or more whitespace characters
  • # - Match one # character
  • (end)? - Optionally match the string end
  • region - Match the string region
  • .* - Match zero or more of any other characters
  • $ - Match the end of the line

This will effectively find all #region or #endregion lines, whether they are indented or not, and whether they have description text after them or not.


In the Edit Menu, the Outlining submenu, you have all the options. Including Toggle All Outlining (Ctrl+M+L by default).

Maybe your key mappings were altered.

If you so desire, you can even select menu:

Edit -> Outlining -> Stop Outlining