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

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.

You can enable dark mode in the VS2019 by modifying a private registry in a next way:
Close all instances of VS2019
Press Ctrl+R and run regedit
Expand HKEY_USERS elements in the tree
File -> Load Hive...
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)
Export te “Dark” theme registry key: HKEY_USERS\vs2019\Software\Microsoft\VisualStudio\16.0_????????_Config\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}
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})
Import the reg file
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

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.

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.
Close all instances of Visual Studio 2019 / 2022
Press Ctlr+R and run regedit
In the node tree, expand HKEY_USERS
Press File -> Load Hive...
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)
Navigate to HKEY_USERS\vs20xx\Software\Microsoft\VisualStudio\1x.0_xxxxxxxx\ApplicationPrivateSettings\Microsoft\VisualStudio
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.
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.

Related

Visual Studio files association in Windows

In Windows Explorer when I double-click on any Visual Studio file (*.cs, *.csproj, etc.), it's opening an old version of VS instead of the latest one (VS 2017). And VS has associations with too many file types.
How can I change the default Visual Studio (for all those files that VS can handle)?
There is a similar old question about Visual Studio 2008 (Move file associations from Visual Studio 2005 to 2008) but the solution in there doesn't work anymore (there is no "Restore File Associations" button on the settings of Visual Studio 2017).
Each version of Visual Studio registers itself in the Set Default Programs panel of the Control Panel.
Go to Control Panel\Programs\Default Programs
Then choose Set Default Programs:
In there you can simply choose the Visual studio version of your choice and then click the button Set this program as default in order to associate every file type that VS handles.
Or you might prefer to click the button Choose defaults for this program to review the current associations of those file types and change only the ones you want.
Yet another in a long list of previously working-just-fine things which Microsoft have managed totally #$#%# up. If I try to change defaults the 'right' way I get this kind of thing:
i.e. completely ignored. The only way I've managed to solve it is by removing the file association entirely through the registry. Let's take .asm as an example:
Open Registry Editor / "regedit.exe"
Navigate to HKEY_CLASSES_ROOT\.asm\OpenWithProgIds
Delete any Visual Studio values you see
From there, you can (finally) open files with whatever you choose instead of having the association clamped to Visual Studio:
For the record, I believe this to be a problem with Windows 10. Not with Visual Studio. See: https://answers.microsoft.com/en-us/windows/forum/windows_10-files/cant-change-default-programs-in-windows-10/229fc3a9-25c9-433b-a333-5806bc5090db
On the file you will always open with vs17, click right and choose open with and there choose another app. On win10 it pop out a dialog with some proposals. If vs17 is there, choose your favorite and activate the always open with. then ok and your done.

Class names not coloured in Visual Studio 2012

I am evaluating Visual Studio 2012 and am having some problems with the color schema.
Sure enough I was able to overcome the initial discomfort by setting my color for the text editor.
One thing I have not been able to set corrent are the color for the class names.
Say you have a line like below.
Class name = new Class();
the entire line is in the same color, expect the new keyword.
I want the word 'Class' to be in a different color like in earlier versions of Visual Studio.
I am not able to set the color for this from the Option.
I have tried chaning color for all fields like plain text, literals, identifier, etc under
Tool -> Option -> Environment -> Font & Colors
but still I am not able to fix this.
I have also applied custome themes, those are also not helping.
I wouldn't want to install a productivity power tool for such basic preference right ??
Edit:
I'm on Windows 7 x64 and Visual Studio Professional 2012, Version 11.0.50727.1 RTMREL
The solution I found is a combination of the suggestions found in a mish mash of related threads:
Close Visual Studio and open the VS command prompt as an administrator. Navigate to the devenv.exe file (in Express versions it is titled something along the lines of *express.exe) usually located in C://Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE.
Type devenv.exe /setup
Reopen Visual Studio. If everything is all colored now, great! If not, close the tabs and reopen them.
Performing all of step 3 is what has got my coloring to come back to normal.
Here is where I got the suggestions:
Visual Studio 2012 - Intellisense sometimes disappearing / broken
How can I get user type C# syntax highlighting working again in VS 2012 RC?
If you're using Productive Power Tools, go to => Tools -> Options -> Productive Power Tools. In main menu, TURN OFF the option: Colorized Parameter Help.
I solved my problem, I'm on Windows 8 Pro, Visual Studio 2012 Ultimate.
You're on the right track. Under Tools -> Options -> Environment -> Fonts and Colors, you want to change "User Types", first making sure at the top of the dialog that you are viewing the settings for the "Text Editor"
Although, by default with my install of Visual Studio 2012 these were already set, so you may want to try the "Use Defaults" button, unless you've made other changes that you want to keep.
go to the tools >Option click on enviroment navigation and click on import and export setting and copy the url and open directory from the url and delete all font and color file .which you got setting folder
The workaround provided by Donatas on Microsoft Connect works without having to turn off any option of Productivity Power Tools:
There is a workaround without turning off "Colorized Parameter Help".
Go to Tools > Options > Environment > Fonts and Colors in Display
items select "User Types (Value types)" click Custom next to Item
foreground color and in the color picker change Red, Green or Blue by
1, i.e. to make a custom color which basically looks the same. OK on
all the dialogs and problem solved.

Why is Visual Studio 2010 not saving Environment General settings?

My installation of VS 2010 does not appear to be saving settings in the Environment section (Recent files, show status bar checkbox, etc). Other settings do save properly, though (Auto Recover, etc).
Any ideas?
My Environment:
Windows XP
Visual Studio 2010 Ultimate, Team Explorer, TFS2010 Power Tools
Visual Studio 2008 and 2005 installed as well
Works on my XP laptop. The one difference between the two that I can think of is that I added the VS Theme extension on the workstation that I am having an issue on. Don't know if that fouled anything up in the registry.
When I modify the settings (like the number of items shown in Window menu input), the settings are not saved to the registry (HKEY_CURRENT_USER/SOFTWARE/Microsoft/VisualStudio/10.0/General/WindowMenuItemCount)
The fact that it's not saved to the registry would seem to indicate a larger problem than just VS. I would recommend using a tool like Process Monitor to see if it's attempting to write to the registry. Add a filter for devenv.exe and search for the registry key you're looking for. In this case, immediately after clicking okay after you set the number of "Recent Files - items shown in Window menu" in Tools->Options->Environment->General, you should see a write (Success) in the registry under that key (WindowMenuItemCount).

Visual Studio - Current file in Solution Explorer - Make it darker?

I don't want to change the entire background color of solution explorer in VS, only the selected file.
Hints?
Thanks.
Check out Tools > Options > Projects and Solutions, and then check off "Track Active Item in Solution Explorer". This will make whichever file you're viewing/editing inside of Visual Studio automatically be selected in Solution Explorer and if your Windows color scheme is set up properly, it will in fact be darker.
This option used to be on by default in 2003 and maybe 2005, but 2008 has it disabled by default now... I personally prefer it turned on.
HKEY_CURRENT_USER\Control Panel\Colors\ButtonFace is the registry key that sets the background color of the current file in solution explorer when solution explorer has not focus, this is what I found for Vs2010 and windows 7 - could not seem to find interface to modify the button face color in the gui. many things use this color, so I set just dark enough to see.
I have no idea why you want to do that in the first place, curious :)
Anyway, I doubt you can change the entire UI's background color depending on the type of file /editor mode.
You might find more clues from these:
Visual Studio - Fonts and Colors, Environment, Options Dialog Box
Changing your colors in Visual Studio.NET - Black versus White
How to increase your Visual Studio environment fonts for presentations?

visual studio property missing characters

I've just started up visual studio express 2008 for the first time in 6 months, and the when I expand the properties window, all the name/values are rendered as squares. Event the ellipses (...) are squares! The weird thing is, all other text is OK, the code, toolbar, menus etc.
What font/character set does visual studio use for this text? and why is only the propert window affected?
That's fairly odd. I haven't seen a bug like that yet.
If it is a font issue, you can fix it by resetting all of your settings. Go to Tools -> Import / Export Settings. Reset all settings and pick your profile. Rebuild and Restart Visual Studio and see if the problem goes away.
My second guess would be to check the file encoding. Visual Studio should work fine with most file encodings but it's not bad to sanity check. Click on File -> Save As and set the text type to be ASCII. Then restart Visual Studio and see if the problem goes away.

Resources