locked
Win7 resizes form developed on Win8 RRS feed

  • Question

  • I'm developing an application with Visual Studio 2010 on Win8.  Everything works fine.  When I install this application on my laptop running Win7 the form is resized. I display the following in a MessageBox in the Load event handler:

    int w = this.Size.Width;

    int h = this.Size.Height;

    Thinking the problem is a display resolution issue (they are different) I resize the display resolution on the Win8 desktop.  Still works fine.  The form is not resized.

    I updated the laptop from .NET Framework 4.0 to 4.5.  This did not change the behavior.

    The end result is I am unable to get the form to display in the same pleasing way on the Win7 laptop as it does on the Win8 desktop.

    Any suggestions would be appreciated.  Thanks.


    Monday, April 1, 2013 5:15 AM

Answers

  • I would guess that it's probably down to Font scaling and/or DPI settings that are different between the two operating systems.

    I would also guess that there's practically nothing you can do about it. 

    Differing DPI settings have been the bane of Developers for as long as they've existing in Windows - even MS Word doesn't cope with them properly so what chance do we have?

    Personally, I disable automatic font scaling in all my forms.  I like having control over my form layout.



    Regards, Phill W.

    • Marked as answer by Mike Feng Sunday, May 5, 2013 6:20 AM
    Tuesday, April 2, 2013 3:54 PM

All replies

  • I would guess that it's probably down to Font scaling and/or DPI settings that are different between the two operating systems.

    I would also guess that there's practically nothing you can do about it. 

    Differing DPI settings have been the bane of Developers for as long as they've existing in Windows - even MS Word doesn't cope with them properly so what chance do we have?

    Personally, I disable automatic font scaling in all my forms.  I like having control over my form layout.



    Regards, Phill W.

    • Marked as answer by Mike Feng Sunday, May 5, 2013 6:20 AM
    Tuesday, April 2, 2013 3:54 PM
  • Phil - Thanks for giving me a clue in the right direction.  I developed on a 1920x1200 display under Win8, but needed to run on a 1024x768 display (size of projector) under Win7.  I sized all my windows to 1024x768 (or smaller) and set AutoScaleMode to NONE.  All looks fine now.  Thanks for the advice, it is much appreciated.

    == al

    Monday, July 22, 2013 12:06 PM