Sizing controls

  • Thread starter Thread starter Alan M Dunsmuir
  • Start date Start date
A

Alan M Dunsmuir

I have a VB.NET Windows Forms application which uses as a splash screen
a Form which I want to cover, exactly and entirely, with a specified
..jpg PictureBox.

So I specified the Form, the PictureBox and the .jpg image as having
exactly the same sizes - 820 wide by 460 deep.

This works perfectly on my development machine and on my Laptop, both of
which run at fairly high screen resolutions.

But when I copy the compiled application to my back-up Desktop machine,
which uses a somewhat lower screen resolution (and has a CRT instead of
a flat monitor), and run it there, the underlying Form shows up as
substantially bigger vertically than the PictureBox, and a couple of
drop-down list controls on the Form appear well below the textual
information (which is actually part of the PictureBox) which is supposed
to explain their use.

What causes this, and how do I avoid it happening?
 
Alan M Dunsmuir said:
So I specified the Form, the PictureBox and the .jpg image as having
exactly the same sizes - 820 wide by 460 deep.

This works perfectly on my development machine and on my Laptop, both of
which run at fairly high screen resolutions.

But when I copy the compiled application to my back-up Desktop machine,
which uses a somewhat lower screen resolution (and has a CRT instead of a
flat monitor), and run it there, the underlying Form shows up as
substantially bigger vertically than the PictureBox, and a couple of
drop-down list controls on the Form appear well below the textual
information (which is actually part of the PictureBox) which is supposed
to explain their use.

What causes this, and how do I avoid it happening?

This behavior is caused by different DPI settings on the maches. Many
laptops/LCDs are used with large fonts (120 DPI), CRTs are typically used
with 90 DPI. You may want to play around with the form's 'AutoScale'
property (see documentation) to prevent this from happening.
 
Back
Top