Form layout on VGA devices

G

Guest

I'm in the process of porting a CF1 app to CF2.

I have designer-generated "InitializeComponent" code to lay out forms. Under
CF1 the forms look fine on VGA devices, but under CF2, the coordinate system
is all wrong. The controls are squeezed together at half the desired
width/height.

I tried overriding the form's ScaleChildren property but it made no
difference.

Can anyone shed any light?

Thanks!
 
C

Christian Resma Helle

Hi David,

Try setting the Form's AutoScaleDimension to 96 x 96 and the Form's
AutoScaleMode to Dpi
 
G

Guest

You can also adjust your draw routing to account for screen resolution. I
usually scale based on 240x320 and then adjust up or down based on a scaling
factor.

Rick D.
Contractor
 
G

Guest

Thanks for the tips!

FWIW, I found that I could only set the AutoScaleDimension to 96x96 after
calling SuspendLayout. Otherwise, the change was ignored.

And after calling ResumeLayout, the AutoScaleDimension reverts to its
previous value (192x192).

This means that any sizes saved during form construction (e.g.saving the
original screen size in OnResizing) are in the wrong scaling factor. Easily
worked around though...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top