3

I have a Windows (XP/Vista/7) application implemented in C# using .NET 3.5 and I have a weird resize problems on a small number of Windows XP machines (I haven't been able to reproduce the problem myself).

The application uses a System.Windows.Forms.Form with a System.Windows.Forms.Panel which holds sub-views. Each sub-view is in itself a System.Windows.Forms.Form. During initialization each sub-view is added to the panel (panel.Controls.Add(sub-view)) and the controller selects sub-view by playing with the Hide and Show-methods of each sub-view.

Figure 1 shows how the application normally looks. The panel is the part with the lovely waterdrop-background-image.

But on some Windows XP machines the application looks like figure 2. The entire application has been resized (weird in itself since I have static Max/Min attributes) and the panel is bigger (and has dropped slightly). The background image repeats and any text on the panel is also resized.

Any ideas what this can be? Can it be a .NET-related problem? I do not have access to the problematic machines so all have to go on at the moment is some blurry screenshots.

Mockup of application resize problem

Update

It is a DPI problem. Changing the DPI setting (on Windows XP) and the application will be resized (but on Vista/7 it stays correct). Thank you for the speedy response guys.

Anders Holmberg
  • 266
  • 4
  • 8
  • 4
    Do the problem machines have the "Large fonts" setting in the display settings? That can sometimes play tricks with how stuff is measured and resized. – Fredrik Mörk May 25 '11 at 12:23
  • Possibly related: http://stackoverflow.com/questions/572820/c-scaling-usercontrol-content-to-match-users-dpi-font-size – GSerg May 25 '11 at 12:28

1 Answers1

1

Isn't this a result of DPI settings which was one of the key things WPF tried to address with it's ability to auto-resize, move, wrap, etc?

There are some similar questions around that involve issues caused by changing DPI:

WPF DPI issues

C# Scaling UserControl content to match users Dpi/Font Size

How to prevent font resize when changing the DPI of the system

high DPI problems

Community
  • 1
  • 1
Smudge202
  • 4,689
  • 2
  • 26
  • 44