Class ControlExtensions
Provides extension methods for Controls.
Namespace: NanoByte.Common.Controls
Assembly: NanoByte.Common.WinForms.dll
Syntax
public static class ControlExtensions : Object
Methods
ApplyScale(Size, ContainerControl)
Scales a Size according to the current auto-scaling factor.
Declaration
public static Size ApplyScale(this Size size, ContainerControl control)
Parameters
Type | Name | Description |
---|---|---|
Size | size | The size to scale. |
ContainerControl | control | The control to get the scaling factor from. |
Returns
Type | Description |
---|---|
Size |
GetScaleFactor(ContainerControl)
Returns the current auto-scaling factor.
Declaration
public static SizeF GetScaleFactor(this ContainerControl control)
Parameters
Type | Name | Description |
---|---|---|
ContainerControl | control |
Returns
Type | Description |
---|---|
SizeF |
Remarks
Assumes the default AutoScaleDimensions of 6, 13 for Font or 96, 96 for Dpi. Unlike AutoScaleFactor this will retain the correct factor even after PerformAutoScale() has run.