0

Afternoon all!

Ever since I switched to my new laptop with a High DPI display, I have noticed that when I make new Windows Forms projects, Text and Images appear blurry and sometimes the size of the form can get bigger.

I found a guide on how to fix this however, it is in C#.

I have changed all my forms 'AutoScaleMode' to DPI rather than font but that has not worked.

Is there any code that needs to be run to make the forms crisp?

Thanks! ProudAviatior

  • Ahh! Thank you! I was looking everywhere for this! Thanks – ProudAviatior Jun 28 '18 at 22:17
  • @ProudAviator : Glad I could help! If it solved your problem, please accept the duplicate so that this question gets closed (you should be able to do so either via a message in the top of your question, or by pressing `close > duplicate of...` beneath your entire post). – Visual Vincent Jun 28 '18 at 23:07

1 Answers1

2

I had the same problem and i looked up everywhere before someone referred me to an answer and I changed the manifest code accoridngly and it works now.

so just open app.manifest and include <dpiAware>true</dpiAware> to make your application DPI-aware:

    <?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
    <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
                <requestedExecutionLevel level="asInvoker" uiAccess="false" />
            </requestedPrivileges>
        </security>
    </trustInfo>
    <asmv3:application>
        <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
            <dpiAware>true</dpiAware>
        </asmv3:windowsSettings>
    </asmv3:application>
</assembly>

It will do your work.

Reference: https://stackoverflow.com/a/13228495

Subaz
  • 897
  • 1
  • 9
  • 24
  • 1
    Since the question is an exact duplicate you generally don't need to answer it. Anyway, remember to include references to where your answer/code came from (or is based on) if it's not yours originally. – Visual Vincent Jun 28 '18 at 09:39
  • okay bro i understand – Subaz Jun 28 '18 at 09:40