1

I am currenlty developing a plugin for an existing 3rd part system. The plugin exposes a GUI, which is defined to be WPF by the plugin framework. However, i have to integrate a legacy WinForms control that is hidden in a library (no source code available).

Using WinFormsHost works great, as long as the Display scaling is set to 100%. If the settings are different, my embedded WinForms control scales awkward and doesn't look good anymore.

  • If I create a WinForms Window and embed the control, scaling is fine.
  • If I create the same window from a WPF application / Window and push the WinForms window into the WPF window with HwndHost, scaling is awkward again.

    It seems that scaling is only correct when i start my WinForms window in a separate process outside the 'WPF' environment. I should be able to catch the separate process' window and get proper scaling, but communication into my legacy window may become tricky then.

    Is there a way to get proper scaling without the detour via a separate process? I know that similar questions have been posted here, but so far i did not find what i was looking for.

    Thanks in advance.

christian
  • 21
  • 1
  • There are apparently different scaling modes Windows uses for different applications. I am sadly not an expert on that, so all I can do is suggest googling "Windows scaling modes" or something. – TripleAccretion Oct 30 '19 at 15:30
  • 1
    Read the notes here: [DPI Awareness - Unaware in one Release, System Aware in the Other](https://stackoverflow.com/a/50276714/7444103) – Jimi Oct 31 '19 at 01:39

0 Answers0