By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,351 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,351 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jun 11 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:A3**********************************@microsof t.com...
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

Jun 11 '07 #2

P: n/a
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.

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:A3**********************************@microsof t.com...
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

Jun 11 '07 #3

P: n/a
On Mon, 11 Jun 2007 09:28:06 -0700, Rich <Ri**@discussions.microsoft.com>
wrote:
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
Jun 12 '07 #4

P: n/a
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?
"Rich" wrote:
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
Jun 12 '07 #5

P: n/a
Rich wrote:
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
Jun 16 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.