System.Windows.Forms.Form.ScaleControl(System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified)

Here are the examples of the csharp api class System.Windows.Forms.Form.ScaleControl(System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: TraceLab
Source File: ExtendedForm.cs
View license
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
        {
            float width = factor.Width;
            Padding newMargin = this.GlassMargin;
            if( width != 1f )
            {
                if( newMargin.Left > 0 )
                    newMargin.Left = (int)Math.Round(newMargin.Left * width);
                if( newMargin.Right > 0 )
                    newMargin.Right = (int)Math.Round(newMargin.Right * width);
            }
            float height = factor.Height;
            if( height != 1f )
            {
                if( newMargin.Top > 0 )
                    newMargin.Top = (int)Math.Round(newMargin.Top * height);
                if( newMargin.Bottom > 0 )
                    newMargin.Bottom = (int)Math.Round(newMargin.Bottom * height);
            }
            GlassMargin = newMargin;
            base.ScaleControl(factor, specified);
        }

2. Example

Project: TQVaultAE
Source File: VaultForm.cs
View license
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
		{
			if (this.DrawCustomBorder)
			{
				if (this.titleFont != null)
				{
					this.titleFont = new Font(this.titleFont.Name, this.titleFont.SizeInPoints * factor.Width);
				}
			}

			base.ScaleControl(factor, specified);

			if (this.DrawCustomBorder)
			{
				this.CreateBorderRects();
			}
		}