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

Rendering issue: AutoScrollMinSize and AutoScale

P: n/a
Hi,

I'm running into a scaling issue.
I'm having a simple form. I have some control in that form (2 group boxes,
one dock to the left , the other set to fill, with some misc. controls in
them).
I set the AutoScroll = true on the form and set the AutoScrollMinSize to 700
(which is good at design time).
On XP system, the default font is set to Microsoft Sans Serif, 8.25 point),
everything looks good.
Now if i run this on a different os (say a chinese os, the font used is
different and i'm getting a font of size 9 pt).
Then it looks like the AutoScale is not doing its job properly as it does
not change that 700 value.

Ami i missing something? Should i avoid using the AutoScrolMinSize?
Any way to set that value properly at runtime?

I appreciate any comments on that one

Thanks for your help

--
Nick
Dec 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 07 Dec 2007 02:46:00 -0800, Nick <Ni**@discussions.microsoft.com>
wrote:
[...]
Then it looks like the AutoScale is not doing its job properly as it does
not change that 700 value.

Ami i missing something? Should i avoid using the AutoScrolMinSize?
Any way to set that value properly at runtime?
I'm not aware of any reason to think that the auto-scaling would affect
your scrollbar ranges. While you happen to be using the scrollbar values
here to represent values tied to the dimensions of the form, there's no
requirement that one do that and so always auto-scaling the scroll bar
values according to the form size would be wrong.

Now, that said...

The current approved mechanism for auto-scaling is to use the
AutoScaleMode and AutoScaleDimensions properties. Along with these is an
AutoScaleFactor that you can use to determine the current scaling, and
with that you can apply a correction yourself to the scrollbar range.

If you really insist on using the deprecated AutoScale property, you can
retrieve the base size through AutoScaleBaseSize and then call the
GetAutoScaleSize(). You can then calculate a ratio yourself from that,
and which you can apply to your scrollbar ranges.

Pete
Dec 7 '07 #2

P: n/a
Hi Peter,

Thanks a lot for your reply.
I'm not using the deprecated AutoScale mecanism, but the result is the same.
What i would like to do is to get that ScaleFactor that has been used to
re-scale my AutoScrollMinSize value, but i'm not sure how to get that
information.
It looks like the scaling process happen before the constructor of the Form.
This means that in the constructor, the value of the AutoScaleFactor is 1 for
both width and height. Once the scale process is done, the AutoScaleFacor is
resseted to avoid further rescale in case the Scale method is called at
runtime. Value of properties CurrentAutoScaleDimension and AutoScaleDimension
are identical (because the scale process is done)

Would you know how i can get the scaling factor used by AutoScale ?

Does that make sense that the AutoScrollMinSize is not rescaled or is this a
..NET bug?

Let me know what you think

Thanks and have a great day

--
Nick
"Peter Duniho" wrote:
On Fri, 07 Dec 2007 02:46:00 -0800, Nick <Ni**@discussions.microsoft.com>
wrote:
[...]
Then it looks like the AutoScale is not doing its job properly as it does
not change that 700 value.

Ami i missing something? Should i avoid using the AutoScrolMinSize?
Any way to set that value properly at runtime?

I'm not aware of any reason to think that the auto-scaling would affect
your scrollbar ranges. While you happen to be using the scrollbar values
here to represent values tied to the dimensions of the form, there's no
requirement that one do that and so always auto-scaling the scroll bar
values according to the form size would be wrong.

Now, that said...

The current approved mechanism for auto-scaling is to use the
AutoScaleMode and AutoScaleDimensions properties. Along with these is an
AutoScaleFactor that you can use to determine the current scaling, and
with that you can apply a correction yourself to the scrollbar range.

If you really insist on using the deprecated AutoScale property, you can
retrieve the base size through AutoScaleBaseSize and then call the
GetAutoScaleSize(). You can then calculate a ratio yourself from that,
and which you can apply to your scrollbar ranges.

Pete
Dec 10 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.