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. Tousif Ahmed 0 Reputation points
    2026-10-05T08:03:34.69+00:00

    This sounds like a DPI scaling or form layout issue rather than a problem with the reload itself. On touchscreen laptops, Windows can apply different DPI or display-scaling values, which may cause a WinForms application to resize or reposition controls when the form is recreated.

    I’d first check the application's DPI-awareness settings and make sure the form is using an appropriate AutoScaleMode, such as Dpi or Font, consistently. Also check whether the form's Anchor and Dock properties are configured correctly instead of relying on fixed pixel positions.

    If the application also handles media or video content, it is worth testing the same scaling behavior with different video sizes, since responsive sizing can expose similar layout problems. For browser-based video tasks, an online video tool like Clipzun avoids many of these desktop-specific UI scaling issues because the processing happens through the browser.

    Was this answer helpful?

    0 comments No comments

  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.