> I have a user control that has this structure from top to bottom:
>
[quoted text clipped - 53 lines]
> RobinS.
> GoldMail.com
So here is what I figured out through trial and error.
The panel on which my controls sit has an AutoScaleMode of "Font".
Apparently when it renders, it scales up and repositions everything on the
screen, which includes spacing the graphics out. When I set this to "None",
the graphics stay in place.
This is a little frustrating, because I have been tasked with changing all
of the forms (and underlying user controls) to display correctly on a
computer running "big fonts" (dpi=120). Right now, our app only looks right
on 96-dpi setting.
Before you post back and say "set autoscalemode to dpi", I'll pass on that I
tried that, and I think the problem I'm having is that the distance on our
splitter controls is hardcoded, as well as the default size of our
application, and apparently I'm going to have to do some math to fix that
problem. We don't want the user to be able to change the splitter position.
Also, from what I've read about AutoScaleMode, if you set it to "Font", it
will scale for both Font and DPI changes. We are not currently really
supporting international users (many have our product, but it's all in
English for the moment), but when we do, I assume I'm going to want the
forms to scale by Font as well as by DPI.
If anybody has any wisdom about the whole AutoScaleMode topic, I'd love to
hear it, as this is looming quite large on my to-do list.
Thanks very much.
RobinS.
GoldMail.com
Peter Duniho - 14 Mar 2008 20:24 GMT
> [...]
> If anybody has any wisdom about the whole AutoScaleMode topic, I'd love
> to hear it, as this is looming quite large on my to-do list.
It seems to me that if you're using any auto-scale mode, you necessarily
give up the right to expect things to be presented exactly as you had
originally designed them.
It's possible that by setting the AutoSize and AutoSizeMode properties on
appropriate controls (such as your UserControls) you get some different
behavior that is more to your liking, or that you can implement your own
auto-scale logic and set the form's scaling to "none". But at the end of
the day, you're asking .NET to resize things according to some external
information, and it shouldn't be too surprising that your carefully
laid-out arrangement gets disturbed.
It may be that the most appropriate solution is simply to not design
something that is so sensitive to variations in size and position. Leave
things some room to be scaled and adjusted without creating problems that
are causing you to dislike the current behavior now.
Pete
RobinS - 16 Mar 2008 04:14 GMT
>> [...]
>> If anybody has any wisdom about the whole AutoScaleMode topic, I'd love
[quoted text clipped - 18 lines]
>
> Pete
I was hoping by setting autoscale mode that it would scale text, not
pictures. That was my expectation. And why would it scale the positioning of
the pictures without scaling the actual pictures as well? It seems
inconsistent to me.
If you are fortunate enough to only support applications where you can put a
bunch of extra space in your panels in case the user has a higher DPI
settings, then that's great. I don't have that luxury.
I figured at this point I would go through each form and user control and
see what works. We have what basically amounts to four panels on the screen
with two across and two down. To make the panels large enough for the text
to be okay when sized up would make the screen ugly for users having dpi set
to 96 dpi. It is clear to me at this point that I am going to have to
programmatically handle the sizing of some of the forms and splitters to
display cleanely without a lot of extra space, and without being truncated.
Thanks anyway.
RobinS.
GoldMail.com
Peter Duniho - 16 Mar 2008 05:41 GMT
> I was hoping by setting autoscale mode that it would scale text, not
> pictures. That was my expectation. And why would it scale the
> positioning of the pictures without scaling the actual pictures as well?
> It seems inconsistent to me.
If it's scaling the picture, it's because you've set the PictureBox
control to stretch the picture. Auto-scaling isn't going to directly
affect how your images render, but it _will_ resize all of the controls
that are affected, and if you've set your PictureBox to both auto-scale
and stretch any contained image, then of course the image within will be
scaled as well as the control itself changes size.
As far as the auto-scaling stuff is concerned, the PictureBox is just like
any other control. It doesn't treat it differently just because it's
containing an image, nor is there any reason to expect that it would know
or care.
I don't find it inconsistent. If anything, it would be inconsistent for
.NET to treat a PictureBox differently, especially given that there are
image display modes for PictureBox that don't stretch the image.
Pete
RobinS - 17 Mar 2008 05:57 GMT
>> I was hoping by setting autoscale mode that it would scale text, not
>> pictures. That was my expectation. And why would it scale the
[quoted text clipped - 18 lines]
>
> Pete
Thanks, Pete. I'll buy that; it makes more sense when you put it that way.
RobinS.
GoldMail.com