Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows XP application (.NET/C#) resize problem

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.

like image 846
Anders Holmberg Avatar asked Aug 24 '26 03:08

Anders Holmberg


1 Answers

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

like image 127
Smudge202 Avatar answered Aug 26 '26 18:08

Smudge202



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!