C# windows Form Project, in laptop touch screen form shrinks and moves when reloads

Gennady Gurin 186 Reputation points
2026-10-02T22:05:35.2333333+00:00

I have Windows Form Project targeting old net framework 4.8, In my project I have to reload a form on certain conditions, so on my PC computer everything working normally but when testing on laptop touch screen the form shrinks and moves when reloading.

Upon searching I had to add line: in my Program.cs file

here: Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);

However, it is undefined. So, upon searching I had to add

lines into my app.config file and create app.manifest file as well.

Anyway, all those files in working directory.

And still is underfired, not sure what to do next?

Anyone responds, thanks in advance.

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Nguyen Dam (WICLOUD CORPORATION) 595 Reputation points Microsoft External Staff Moderator
    2026-10-05T03:12:23.9266667+00:00

    Hello @Gennady Gurin , and thank you for reaching out.

    For your main issue, "reload" could mean a few different things, so it's difficult to tell what you've tried so far. For example, you may be calling Refresh(), or creating a new instance of the form. If it's the latter, that would likely explain why the size and position are reset, and reusing the existing form instead should help. If that isn't what you're doing, could you please share the snippet that performs the "reload"? That would enable me to support you better.

    Regarding the other point you mentioned, this may not be related to your actual issue, and it could be taking you down a different path. Application.SetHighDpiMode(HighDpiMode.PerMonitorV2) is undefined because it isn't available in .NET Framework 4.8, but in newer .NET versions of Windows Forms.

    As for app.config and app.manifest, if you added DPI-awareness settings there, for example by following High DPI support in Windows Forms, those settings would enable DPI awareness for the project itself but wouldn't make Application.SetHighDpiMode(HighDpiMode.PerMonitorV2) available. If you'd still like to confirm those settings are in effect, you can check the DPI awareness column in the Details tab of Task Manager while your app is running.

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. Thank you. 

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.