C # - Problem with layouts for Windows XP professionals

I am developing a C # application with .NET Framework 2.0.

The problem is, on my client PC, the controls expand, layout changes (positions of controls change), sometimes buttons are skipped altogether. This happens even in Forms with 2-3 text fields, 2-3 buttons and some labels. I've tried a lot of research. I tried to show a message in the resize form. But it is not called. After digging a little more, it seemed like in the file Designer.cs

, although ResumeLayout (false) is being called for the form, but this is causing the controls to expand / position.

My client is using Windows XP Professional on his Dell laptop. It is able to reproduce the problem on other laptops by a Windows XP professional. But not on other operating systems (like Windows XP Home or Windows Vista). On my desktop with Windows XP pro, it won't play.

How to solve this problem?

+2


source to share


2 answers


Are you sure it has anything to do with the OS? It looks more like a dpi resolution issue. "Normal" is 96 dpi. If the shape was designed at 96dpi, it is likely to be different in different settings.

See this article on how to check / change dpi settings in XP.



Edit: I forgot to mention that you can use a TableLayoutPanel Control to lay out your form. Using automatic scaling capabilities will help keep things normal at any dpi setting.

+4


source


This is likely due to the DPI setting in Windows XP.

If you are using the default (96) DPI setting, but they are configured using an alternative (such as 120), this will often mess up control layouts.



The "right" way to deal with this is to try to automatically build your layouts with layout elements that can change as needed. This is tricky in Windows Forms (and one of the things WPF fixes).

+3


source







All Articles