0

I recently introduced a WPF control to my VB.net WinForms application. The control looks good and works great. However, depending on which environment I run the application, I will get different behavior. The two machines that differ are both running Windows 8.1 with the default theme.

I have read a few questions about adding proper theme settings and I don't believe that is the issue.

In the environment that is incorrect I have observed the following behavior:

  • Upon loading the form containing the WPF control, the calling form will resize and move around the screen
  • Controls contained within the form that also contains the WPF control will often "ghost" upon resizing the application
  • Both the calling form and the form containing the WPF control shrank upon loading the containing form. By shrank I mean window size, control size of all controls, font size, etc...

I'm wondering if the application was built against one version of the library and the DLL versions differ on the deployment environments. But I'm not sure how to look for this.

Has anyone encountered this before?

dpsthree
  • 2,225
  • 4
  • 21
  • 23

1 Answers1

0

I found the problem.

This was the result of DPI scaling. The application was acting out anytime the DPI settings were set to anything other than 100%. WPF controls scale differently from Winform controls causing the strange behavior. The following stackoverflow Q/A explains how to remove the DPI dependency

Disable DPI awareness for WPF application

Community
  • 1
  • 1
dpsthree
  • 2,225
  • 4
  • 21
  • 23