16

I maybe going mad, but for the life of me I can't find the option to change the colour of collapsed region's in VS2008.

For example if I have the following code:

#region Test Region

CallSomeCode();

#endregion

If I now collapse that region it has the title "Test Region" in a grey text color with a grey box around it.

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188
Oliver Hume
  • 489
  • 1
  • 7
  • 19

4 Answers4

21

Tools→Options→Environment→Fonts and Colors→Display items[Collapsible text]

Joey
  • 344,408
  • 85
  • 689
  • 683
17

In VS 2012 the following worked for me:

  • To change color of #region / #endregion - set 'Preprocessor Keyword'
  • To change the text after #region when collapsed- set 'Collapsed Text (Collapsed)'
  • To change the text when expanded - set 'Plain Text', but beware this also changes ; ( [ etc

You may need to restart VS to take effect

Personally I wish there was two types of comments - one for disabling code, and one for explanatory remarks. They are two very different things but generally treated the same in most languages

userSteve
  • 1,554
  • 1
  • 22
  • 34
15

For those using VS 2015 that end up here, this is what worked for me in VS 2015:

#region and #endregion Keywords: Preprocessor Keyword [immediately applied]

Text After #region Keyword: Preprocessor Text [immediately applied]

Collapsed Region: Collapsed Text (Collapsed) [must restart Visual Studio]

A Picture

Maximilian Ast
  • 3,369
  • 12
  • 36
  • 47
TxCsharper
  • 616
  • 7
  • 6
  • 1
    Small maybe obvious note, this obviously deals with all preprocessor text like `#if Debug`. I haven't seen any way to target region and more "passive" without affecting conditionals. – Thor Jul 11 '17 at 14:58
1

in VS 2010, it is Tools→Options→Environment→Fonts and Colors→Code Snippet Field

Dio Phung
  • 5,944
  • 5
  • 37
  • 55