controlling aspect ratio - same as Java on a form resize? (not im

G

Guest

Hello,

If I create a form in Java with controls like Panels, textboxes... when I
stretch/shrink the form, all the controls can grow/shrink - along with the
text contained in the textboxes. This is convenient for resizing a form for
different screen resolutions.

I can't see how to do this /control this in .Net (VS2005). I have a user
that uses 800x600 resolution, and my apps appear very large on this user's
workstation. How can I control the aspect ration besides creating a smaller
scale app (which is what I ended up doing - real small on my workstation but
perfect on the user's workstation). Or besides physically writing a bunch of
code that resizes each control?

Thanks,
Rich
 
M

Michael A. Covington

Rich said:
Hello,

If I create a form in Java with controls like Panels, textboxes... when I
stretch/shrink the form, all the controls can grow/shrink - along with the
text contained in the textboxes. This is convenient for resizing a form
for
different screen resolutions.

I can't see how to do this /control this in .Net (VS2005). I have a user
that uses 800x600 resolution, and my apps appear very large on this user's
workstation. How can I control the aspect ration besides creating a
smaller
scale app (which is what I ended up doing - real small on my workstation
but
perfect on the user's workstation). Or besides physically writing a bunch
of
code that resizes each control?

Thanks,
Rich
 
M

Michael A. Covington

I believe .NET 3.0 provides a neat way to do this. In 2.0 and below, the
only way I've ever done it has been to handle the Resize event and compute
new sizes for everything.
 
P

Peter Duniho

If I create a form in Java with controls like Panels, textboxes... when I
stretch/shrink the form, all the controls can grow/shrink - along with
the
text contained in the textboxes. This is convenient for resizing a form
for
different screen resolutions.

A suggestion:

You are misusing the term "aspect ratio", which describes the ratio
between the width and the height, using it instead to simply describe
scaling of the window.

It is true that if you can accomplish the scaling, you will also likely
want to control the aspect ratio. But it appears from your question that
your primary concern is to control the scaling.

You will get better responses if you use the right terminology in your
question, since if you are using the wrong terminology, some people who
might know the answer to your question may just skip over your post
thinking they don't.

As far as your specific question goes, I don't know the answer off the top
of my head. You can accomplish _part_ of what you're asking about by
using the various the anchoring properties in the controls on your form.
I suppose you could combine that with some code in the Resize event that
changes the font size for the form as a function of the size relative to
the original size, but I've never tried this myself. My recollection is
that you can have the child controls inherit the parent's font, but if I'm
wrong about that you can easily enumerate all the children and set their
font explicitly.

And as I alluded to, if you do all that you may also want to include code
in the Resize event that restricts the new size to one with an aspect
ratio that is identical to the original aspect ratio.

Pete
 
G

Guest

Thank you all for your replies.

Yes, "Scaling / Aspect Ration" I think is what I was trying to ask about.
Anyway, it seems easier (for now) to do what I have been doing - having 2
different sizes of the same app. The only hassel is that whatever I do to
one app I have to do to the other app.

I guess I will do the lazy thing and wait for .Net 3.0 to come out in full
bloom. Will VS2005 work with .Net 3.0?
 
G

Guest

Rich said:
I guess I will do the lazy thing and wait for .Net 3.0 to come out in full
bloom. Will VS2005 work with .Net 3.0?

Does it have an option to choose .NET version ?

Arne
 

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