System.Windows.Forms.Control.Scale C# (CSharp) Method

Scale() private method

private Scale ( SizeF factor ) : void
factor SizeF
return void
		public void Scale (SizeF factor)
		{
			BoundsSpecified bounds_spec = BoundsSpecified.All;

			SuspendLayout ();

			if (this is ContainerControl) {
				if ((this as ContainerControl).IsAutoScaling)
					bounds_spec = BoundsSpecified.Size;
				else if (IsContainerAutoScaling (this.Parent))
					bounds_spec = BoundsSpecified.Location;
			}

			ScaleControl (factor, bounds_spec);

			// Scale children
			if ((bounds_spec != BoundsSpecified.Location) && ScaleChildren) {
				foreach (Control c in Controls.GetAllControls ()) {
					c.Scale (factor);
					if (c is ContainerControl) {
						ContainerControl cc = c as ContainerControl;
						if ((cc.AutoScaleMode == AutoScaleMode.Inherit) && IsContainerAutoScaling (this))
							cc.PerformAutoScale (true);
					}
				}
			}

			ResumeLayout ();
		}

Same methods

Control::Scale ( float ratio ) : void
Control::Scale ( float dx, float dy ) : void

Usage Example

Example #1
0
 public static void CallControlScale(Control c, object[] obj)
 {
     if (obj.Length == 1)
     {
         c.Scale((float)obj[0]);
     }
     else if (obj.Length == 2)
     {
         c.Scale((float)obj[0], (float)obj[1]);
     }
 }
All Usage Examples Of System.Windows.Forms.Control::Scale
Control