me.autoscale

  • Thread starter Thread starter Ganesh J. Acharya
  • Start date Start date
G

Ganesh J. Acharya

SHREE GANESHA

how does this work???????????????????????????????????????????????????????

the documentation says that, if the font in the form container changes
automatically the form adjust it size

please tell me how this is done

Ganesh J. Acharya
B.Sc
Preparing for MCSD
 
what more do you need ?

Gets or sets a value indicating whether the form adjusts its size to fit the
height of the font used on the form and scales its controls.

[Visual Basic]
Public Property AutoScale As Boolean
[C#]
public bool AutoScale {get; set;}
[C++]
public: __property bool get_AutoScale();
public: __property void set_AutoScale(bool);
[JScript]
public function get AutoScale() : Boolean;
public function set AutoScale(Boolean);
Property Value
true if the form will automatically scale itself and its controls based on
the current font assigned to the form; otherwise, false. The default is
true.

Remarks
You can use this property to allow your form and its controls to
automatically adjust based on changes in the font. This can be useful in
applications where the font might increase or decrease based on the language
specified for use by Windows.

To obtain the size the form will auto scale to, use the AutoScaleBaseSize
property. If you want to determine the size the form will auto scale to
based on a specific font, use the GetAutoScaleSize method.

Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows
2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
family


--
Regards - One Handed Man

Author : Fish .NET & Keep .NET
=========================================
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
Ganesh J. Acharya said:
the documentation says that, if the font in the form container changes
automatically the form adjust it size

Do you want to change the size at runtime?
 
Ganesh,
Charles Petzold in "Programming Microsoft Windows with Microsoft Visual
Basic .NET" has a write-up on what is going on with the AutoScale property.
And how to use it.

Its a little long winded for me to paraphrase here.

The short of it is the documentation is correct, when you load the form.
After the form is loaded the documentation appears to be wrong (or at least
misleading).

Does this mean the documentation is in error, or we are just interpreting
the documentation incorrectly? I don' know.

If you get a chance read the 8 pages on the Auto Scale property in Petzold's
book.

Hope this helps
Jay
 
----------------------SHREE GANESHA------------------------
Yes,
I need to know see form changing its aspect with the change
in the size of the fonts during the runtime

It would be very nice of you if you can find me a way

Thanking you
Ganesh J. Acharya
B.Sc
 
Ganesh J. Acharya said:
----------------------SHREE GANESHA------------------------
Yes,
I need to know see form changing its aspect with the change
in the size of the fonts during the runtime


I think the size does not change immediatelly. The size automatically
changes the next time you open the Form.
 
Hello,

Ganesh J. Acharya said:
I need to know see form changing its aspect with the change
in the size of the fonts during the runtime

It would be very nice of you if you can find me a way

See Jay's reply. In the worst case you must scale all the controls by
hand...

;-(
 
Herfried,
Actually you can use Control.Scale to scale all the controls at once.

If you call Form.Scale (inherited from Control.Scale) the entire form will
be scaled.

The book I referenced earlier describes the correct way of doing this. In
fact he gives a fun little program with a series of buttons that allows the
entire form to change size based on which button you press.

NOTE: Control.Scale should not not be confused with Graphics.ScaleTransform.
Control.Scale can be used to 'zoom' the form itself and any child controls
it has no effect on Drawing. While Graphics.ScaleTransform can be used to
'zoom' any drawing that you do.

However Control.Scale is the 'manual' way of doing its not automatic per se.

Hope this helps
Jay
 
Hello,

Jay B. Harlow said:
Actually you can use Control.Scale to scale all the controls at
once.

If you call Form.Scale (inherited from Control.Scale) the entire form will
be scaled.

Seems to work really good, nevertheless the font size is not scaled (you
mentioned that). I do not have the book, but maybe I will read it soon.

:-)
 
Back
Top