Automatic highlight while editing enums, structs, and functions makes text unreadable

George Ford 20 Reputation points
2026-09-07T11:26:26.4766667+00:00

I am using dark mode in Visual Studio with the default settings. When I edit enums, structs, and functions in c/c++, the text highlights and becomes unreadable. I can not find the setting to change the color or disable it.

editEnum

Any help or suggestions would be greatly appreciated.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


Answer accepted by question author
Bruno Caetano de Brito 495 Reputation points
2026-10-18T00:37:06.57+00:00

Hi George,

From your screenshot, that box isn't a normal selection/reference highlight. It's the rename suggestion: when you change the name of a symbol at its declaration (enum member, struct, function), Visual Studio marks the edited identifier with a dashed box and shows the light bulb offering "Rename '<old>' to '<new>'" for the other references. The problem is that the background color used for that marker has very poor contrast in the Dark theme.

You can change that color:

  1. Go to Tools > Options > Environment > Fonts and Colors.
  2. Make sure "Show settings for:" is set to "Text Editor".
  3. In "Display items", look for the refactoring/rename suggestion entry (in earlier versions it was named "Refactoring Suggestion"; type "Refactoring" or "Rename" with the list focused to jump to it).
  4. Change its "Item background" to a darker color (or set it to Default/Automatic) and click OK. Reopen the file if the change doesn't apply right away.

Notes:

  • "Disable Reference Highlighting" under the C/C++ options controls a different feature (highlighting all occurrences of the selected symbol), so it won't affect this box.
  • The marker disappears once you accept the rename from the light bulb (or Ctrl+.) or move on, so it's only shown while the edit is "pending".
  • If the colors still look wrong after changing them, try Tools > Import and Export Settings > Reset all settings (export a backup first), since a stale Fonts and Colors cache can keep old colors.

If you can tell us your Visual Studio version (Help > About), I can point you to the exact item name for that version.

Sources:

Was this answer helpful?

4 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.