ScaleHelperGetScale(Control) Method

Gets the current scale factor of the specified control. If per-monitor DPI awareness is not enabled, it always returns SystemScale.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static PointF GetScale(
	this Control control
)

Parameters

control  Control
The control for which the scale factor is requested.

Return Value

PointF
A PointF representing the scale factor of the control, where X and Y are the horizontal and vertical scale factors, respectively.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Control. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If the handle of the control is not created yet, or if the control is not hosted in a window, this method returns the value of the SystemScale property.

See Also