Class ScaleRules
- Namespace
- RDCore.Forms.Drawing
- Assembly
- RDCore.Forms.dll
How a form's or a PictureBox's scale follows what is set on it while it is shown or edited: VB6's rules for ScaleMode,
ScaleLeft, ScaleTop, ScaleWidth and ScaleHeight.
public static class ScaleRules
- Inheritance
-
ScaleRules
- Inherited Members
Remarks
Setting ScaleLeft, ScaleTop, ScaleWidth or ScaleHeight makes the scale a User
one, even to the value it has, and the other three keep theirs. Setting ScaleMode to a unit sets ScaleLeft and
ScaleTop to 0, and ScaleWidth and ScaleHeight to the inside in that unit; setting it to
User keeps the four.
A change of size, BorderStyle or Appearance changes the inside. In a unit, ScaleWidth and ScaleHeight
follow it. In a user scale the unit keeps its size: ScaleWidth and ScaleHeight grow and shrink with the inside, and
ScaleLeft and ScaleTop stay.
A Line the component holds keeps its place when one of the five properties changes the scale: its X1, Y1, X2
and Y2 are given again in the new scale. A change of the inside leaves them as they are.
A designer file's values are read as it holds them, so a form follows these rules only once Follow(ComponentInstance) is called on it.
Methods
Follow(ComponentInstance)
Makes a component's scale follow these rules from now on. Where its ScaleMode is a unit, its ScaleWidth and
ScaleHeight are set to its inside in that unit at once.
public static void Follow(ComponentInstance component)
Parameters
componentComponentInstanceThe component. One with no
ScaleMode, such as a Frame, has no scale to follow.
Remarks
A component follows them once however often it is called, for as long as it lives.
Exceptions
- ArgumentNullException
componentis null.