Resolution Resize

  • Thread starter Thread starter Ellis Yu
  • Start date Start date
E

Ellis Yu

Dear all,

In vb6, I'll do it by getting the ratio between the resolution
setting in screen and in design mode. Afterward, adjust each control's
position and size with the ratio according to the control type. Is there any
other way do it in .Net? Thanks

Best Rdgs
Ellis
 
Ellis Yu said:
In vb6, I'll do it by getting the ratio between the resolution
setting in screen and in design mode. Afterward, adjust each control's
position and size with the ratio according to the control type. Is there
any
other way do it in .Net?

Take a look at the form's 'Scale' method.
 
Ellis,
In addition to the form's Scale method, you can use AutoScale = true & the
form will take care of it for you (I've hadn't had any real problems with
AutoScale, however I've seen reports other's have).

Charles Petzold's book "Programming Microsoft Windows With Microsoft Visual
Basic .NET - Core Reference" from MS Press includes a section on how
AutoScale & Scale works. Plus gives code & explains how to do your own
scaling...

Hope this helps
Jay
 
Thanks Jay, but it seems not work in my case. When I change the resolution
from 600*480 to 1024*768, the screen layout can't retain the same as
600*480. It'll get smaller b4 change. And I found the default setting in
Form already marked to "True". And also, I try some code given from the Web
as below

Dim sf as SizeF

sf = Me.GetAutoScaleSize(me.Font)
Me.AutoScaleBaseSize = sf.ToSize

But it still don't work. It's so strange.
 
Ellis,
As I stated Charles' book explains how it works.

I have a busy weekend, I will try to work up an example later...

Hope this helps
Jay
 
But I don't know why it remains the same even I call the method ".Scale" and
the autoscale is set to true
 

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

Back
Top