I had this problem in Visual Studio 2019 on Windows 11 with a laptop and an extended display configuration that had the same resolution.
This is the issue
Visual Studio 2019 code editor appears blurry on a Web Forms page (but not the code behind file)
- 1 - Laptop = main display at 1920 x 1080 (6 bit / 60 Hz)
- 2 - External Display = extended display at 1920 x 1080 (8 bit / 60 Hz)
Example 1
- Laptop configured as 125% (recommended) scaling
- External Display configured as 100% (recommended) scaling
Result = Text did not appear clearly in editor
Example 2
- Laptop configured as 125% (recommended) scaling
- External Display configured as 125% scaling
Result = Editor appeared clearly but display 2 appeared with larger text
Example 3
- Laptop configured as 100% scaling
- External Display configured as 100% (recommended) scaling
Result = Editor appeared clearly but display 1 appeared with smaller text
Working - Setting the higher resolution display as primary
As suggested by Anton on this thread, the actual solution was to set the highest resolution display as the main display device (in my configuration it was the 8-bit external display), set the recommended scaling for each display and restart the PC.
On Windows 11 set the recommended scaling for each display
- Open "Settings"
- Search for "Display Settings" and select it
- Click the higher resolution display where it says "Select a display to change the settings for it"
- Expand the "Multiple displays" sub-tab
- Tick "Make this my main display"
- Select the "Recommended" scale % option for each display
- Restart machine
- Check the applications that weren't displaying clearly
Both screens should display at their recommended scale resolution correctly.
During Windows login the laptop display will be blank and the external display will be active if the external display is the main display device and it is connected.
Make sure the external display is switched on during Windows login, otherwise the laptop display will still remain blank. Or disconnect the external display to switch back to the laptop during the login.
Checking Bit Depth
If you have both displays that have the same resolution, set the primary display as the one with the higher bit depth. My Laptop was only 6 bit while the external display was 8 bit.
You can check what this is by opening the "Display settings" and select the first display device and open "Advanced display". This will indicate the selected refresh rate and the current bit depth.