How to get Visual Studio 2012 to grey out ifdef in

2019-06-17 21:48发布

问题:

In our code there are lots of passages that are ifdef'ed out. With the former version of Visual Studio, they had been greyed out. With Visual Studio 2012, however, they are no longer greyed out but dimmed, i.e. these passages appear with all the colours of the syntax highlighting scheme, but with less saturated colours. The programmer at Microsoft who implemented this must have thought this very cool, but in practise it makes it really hard to tell if a passage is active or inactive.

Has anyone found a way to tricking Visual Studio 2012 to using the old way of greying out inactive passages?

Thanks for any reply

回答1:

You have an Opacity setting you can change:

In Tools -> Options -> Text Editor -> C/C++ -> Formatting you can change the Inactive Code Opacity Percent. Default is 65, change it to something higher.
Or
Just set the Disable Inactive Code Opacity to True if you want to cancel this altogether.