1

Possible Duplicate:
Creating a DPI-Aware Application

I have an application which is developed in XP using .net Framework 3.5. few customers are running this application on Windows 7. Application runs without any problem.

But space between the labels and text boxes are reduced. In-fact, one sits on another. this problem is solved, when I set the font to 100% which was set at 125%. And also I set the DPI to 96 which was set at 120.

My question is, how to built the my application in C# winforms which will look as same as in XP, no matter which on which OS it is running. Looks I mean to say, space between the elements and font size on the winform.

I am using VS2010, C# .net 3.5 and developing on XP.

Please help me. Thank you, Harsha

Community
  • 1
  • 1
Harsha
  • 1,861
  • 7
  • 28
  • 56

1 Answers1

3

The issue is nothing to do with Windows versions. You will have the same problem on XP if you use font scaling.

What you want to do is to arrange that your form scales itself automatically when it is opened on a machine with font scaling different from 100%. This can be achieved by setting the form's AutoScaleMode to Dpi or Font.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490