-->

How do I use visual studio 2012 dark theme with wi

2019-01-13 21:19发布

问题:

When I use a standard Windows aero theme in Windows 8, the VS2012 lets me to choose between light and dark themes, but I created myself a convenient high contrast theme in Windows 8, and now there is only a greyed option in the VS settings that says "high contrast", and I cannot change it.

I belong to the few people, who like the new dark theme of Visual Studio, but unfortunately I can't use it with the new high contrast Windows themes.

Can someone help me with this one?

回答1:

My colleague found a way to use the Dark theme in Visual Studio when Windows uses the High Contrast mode. He followed these steps:

  1. Export this registry key:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Themes{1ded0138-47ce-435e-84ef-9ec1f439b749} (this should the key of the Dark theme)

  1. In the exported file 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}):

  2. Import the reg file

Start Visual Studio. This works for him. It's even possible to mix theme settings from the High Contrast theme with those of the Dark theme. Just replace one of the subkeys content with one of the subkeys of another theme.

The GUID's for the themes appear to be the same on both our systems. But you should always check them before you try this. Also a backup of the keys is recommended!



回答2:

Here's the register change that changes the high contrast skin into the dark skin in Visual Studio 2015. By applying this file you can use the dark skin when Windows runs in High Contrast.

USE AT OWN RISK!!!

Export the reg values for the High contrast and Dark skin from HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Themes\ (You can see which one it is at the value from the name field)

Change the GUID in the Dark Skin export to the GUID from the High Contrast skin export. (Use "Replace All" to do this) (The GUID looks something like this: {a5c004b4-2d4b-494e-bf01-45fc492522c7})

Addition: Copy the values from the Workflow Designer part of the High Contrast skin export and paste it in the Dark skin export (this layout is better than the Dark skin layout for this designer)

Save the changed Dark skin export and execute it while VS2015 is not running.



回答3:

As you've found, the High Contrast theme in Visual Studio is automatically linked to enabling Windows' "High contrast" mode in "Ease of Access".

While you can't change themes while that mode's active, you can still change some color settings (editor, windows, etc.) directly via Tools -> Options -> Environment -> Fonts & Colors. Many settings come directly from Windows, but you still have some options here.

Not for this scenario, but just FYI for anyone intrested in tweaking themes, the Visual Studio 2012 Color Theme Editor extension is pretty handy. Scott H. has a post on using it.



回答4:

I made a PowerShell Script for this because I kept having to update the registry values with every update.

This is for Visual Studio 2015. You would just need to update the location values for the others.

$HighConstrastTheme = "HKCU:\SOFTWARE\Microsoft\VisualStudio\14.0_Config\Themes\{a5c004b4-2d4b-494e-bf01-45fc492522c7}"
$DarkTheme = "HKCU:\SOFTWARE\Microsoft\VisualStudio\14.0_Config\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}"

Remove-Item -Path $HighConstrastTheme -Recurse
Copy-Item -Path $DarkTheme -Destination $HighConstrastTheme -Recurse