开发者

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

开发者 https://www.devze.com 2023-03-08 12:12 出处:网络
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 my

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.

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

Update

It is a DPI problem. Changing the DPI se开发者_如何学Pythontting (on Windows XP) and the application will be resized (but on Vista/7 it stays correct). Thank you for the speedy response guys.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消