winformscompact-frameworkwindows-cehandheldhandhelddevice

How can I prevent my form from vertically stretching when "live"?


My form looks gorgeous (YMMV) at design-time:

enter image description here

...but gets "stretchy" vertically when running on the device and, in fact, is a little too tall for the screen:

enter image description here

Why would this happen, and how can I prevent it from happening?

Possibly noteworthy: Form's WindowState == Normal, FormBorderStyle = FixedDialog


Solution

  • please check your form settings: AutoScaleMode and Size settings.

    Is this your first Windows CE application? You have to keep in mind that there are devices with different resolutions (ie QVGA, square like 320x320 pixels, etc), so you should adjust your layout to the screen size. Or make your form maximized and set AutoScroll to enbaled (if the content does not fit).

    When you design your form, you are using pixel counts. These are transformed to twips (1/1440dpi) and again transformed (on the device) back to pixels (including a correction for the resolution, the dots-per-inch (dpi)). So a form with 240x240 pixels will have adifferent size on a 96dpi and a 102dpi display. This scaling is controlled by AutoScaleMode.