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.
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:
- Go to Tools > Options > Environment > Fonts and Colors.
- Make sure "Show settings for:" is set to "Text Editor".
- 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).
- 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: