TejasGondalia
TejasGondalia

Reputation: 168

Using visual studio 2019 in dark mode with high contrast in Windows 10

Is there anyone who is using Visual studio 2019 in dark mode with High contrast? If yes, can you tell me exactly how to do that?

As far as I know, Visual studio doesn't have an option to use High contrast for dark mode (it's there only for blue theme which I don't want).

And also if I change my Windows OS to use high contrast mode and come back to Visual studio, and then by default VS adjusts itself to high contrast but it's very poor to read (it reads like plain white text on a black blackground devoid of any other colors)

I was wondering if there's something in VS 2019 which is similar to Visual studio code high contrast mode or maybe IntelliJ Idea which is very user friendly and serves the purpose.

Thanks in advance.

Upvotes: 1

Views: 3007

Answers (3)

kek5chen
kek5chen

Reputation: 100

The most clean way is to modify the current used theme as this is the behaviour Visual Studio executes when changing themes in the settings.

  1. Close all instances of Visual Studio 2019 / 2022
  2. Press Ctlr+R and run regedit
  3. In the node tree, expand HKEY_USERS
  4. Press File -> Load Hive...
  5. In the dialog navigate to C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio\16.0_XXXXXXXX or if you use Visual Studio 2022 C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio\17.0_XXXXXXXX and load the privateregistry.bin file. It will ask you to give some name, for example, "vs2019". (before proceeding a backup of the privateregistry.bin file is advised)
  6. Navigate to HKEY_USERS\vs20xx\Software\Microsoft\VisualStudio\1x.0_xxxxxxxx\ApplicationPrivateSettings\Microsoft\VisualStudio
  7. There, set the value of ColorTheme and ColorThemeNew to 0*System.String*1ded0138-47ce-435e-84ef-9ec1f439b749 and 0*System.String*{1ded0138-47ce-435e-84ef-9ec1f439b749} respectively. If you wish any other color please check HKEY_USERS\vs20xx\Software\Microsoft\VisualStudio\1x.0_????????_Config\Themes\ for the theme IDs.
  8. Click on the loaded node in the node tree named vs20xx and then File -> Unload Hive...

This will change the setting in Visual Studio to use a different theme instead of changing the themes themselves and will most likely be persistent after updates.

Upvotes: 0

noamnotyou
noamnotyou

Reputation: 1

Visual Studio likes resetting this pretty often so I made a cmd script that lets you select what theme to override 'High Contrast' with instead of doing all of those steps manually each time.

Get the script here.

Upvotes: 0

romaneo
romaneo

Reputation: 33

You can enable dark mode in the VS2019 by modifying a private registry in a next way:

  1. Close all instances of VS2019

  2. Press Ctrl+R and run regedit

  3. Expand HKEY_USERS elements in the tree

  4. File -> Load Hive...

  5. In the dialog navigate to C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio\16.0_XXXXXXXX and load privateregistry.bin file. It will ask you to give some name, for example, "vs2019". (it might be useful to store somewhere a copy of privateregistry.bin file for backup)

  6. Export te “Dark” theme registry key: HKEY_USERS\vs2019\Software\Microsoft\VisualStudio\16.0_????????_Config\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}

  7. Replace the GUID of the “Dark” theme ({1ded0138-47ce-435e-84ef-9ec1f439b749}) with the GUID of the “High Contrast” theme ({a5c004b4-2d4b-494e-bf01-45fc492522c7})

  8. Import the reg file

  9. Important: Click on vs2019 -> File -> Unload Hive...

Note, it might happen after Windows or VS updates, your setting will be erased. In this case, you need only to load hive, import modified file from step 7, and don't forget to unload hive.

Inspired by this post: Visual studio 2017 high contrast theme dark registry hack

Upvotes: 2

Related Questions