Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My Visual Studio 2013 applications have blurry fonts when running on Windows 10

After upgrading to Windows 10 my Visual Studio 2013 forms, when running, appear blurry and in a different style than what Visual Studio 2013 pictures it in design mode.

I tried installing Visual Studio 2015 and the blurry effects are still the same.

Also there are many other changes such as the elimination of 3D buttons.

This is the form in edit mode

This is the form in Run time Mode

like image 981
user2793447 Avatar asked Aug 12 '15 23:08

user2793447


People also ask

How do I fix the blurred font on Windows 10?

Turn the setting for fixing blurry apps on or off manuallyIn the search box on the taskbar, type advanced scaling settings and select Fix apps that are blurry. In Fix scaling for apps, turn on or off Let Windows try to fix apps so they're not blurry.

Why does some text look blurry in Windows 10?

Adjust DPI Scaling Blurry text might be the result of incorrect global text scaling settings. Windows attempts to scale your text so that it remains readable on high-resolution displays. For example, if you're using a 27” 4K display, the text would be almost unreadable without 20/20 vision.

Why do some programs look blurry?

Some apps appear blurry because you're using a high resolution on your screen. In this case, you can lower your resolution and see whether that fixes the problem. If this doesn't fix the issue, you can easily revert back to the old resolution.

Why do my fonts look blurry?

Blurry font problems can be caused by cables that aren't connected properly, older monitors, and poor screen resolution settings.


2 Answers

Call external functions to set it across your entire application. It doesn't get any easier than this:

 [STAThread]
    static void Main()
    {
        **SetProcessDPIAware();** //THIS
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }

    //ADD THESE TWO LINES !!
    [System.Runtime.InteropServices.DllImport("user32.dll")]
    private static extern bool SetProcessDPIAware();
like image 157
Ayson Baxter Avatar answered Sep 27 '22 16:09

Ayson Baxter


Apparently this problem started with Windows 8, which I avoided like the plague.
This is the solution I found:

Add a manifest by going to to Project > Add New Item > Application Manifest File.

For Visual Studio 2015 and above, you can simply uncomment this code:

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
</application>

In older versions of Visual Studio, you need to add this code yourself as it won't be in the manifest automatically.

like image 38
user2793447 Avatar answered Sep 27 '22 18:09

user2793447