Skip to main content

dxTryGetScaleFactorForControl(TControl,TdxScaleFactor) Method

Attempts to retrieve the specified control‘s scale factor.

Declaration

function dxTryGetScaleFactorForControl(AControl: TControl; out AScaleFactor: TdxScaleFactor): Boolean;

Parameters

Name Type
AControl TControl
AScaleFactor TdxScaleFactor

Returns

Type
Boolean

Remarks

A control has a scale factor only if the control or one of its parents is DPI-aware (that is, implements the IdxScaleFactor interface). The dxTryGetScaleFactorForControl global function iterates through the control passed as the AControl parameter and all its parents until it finds a scale factor or reaches the last parent in the chain. The function returns False in latter case; otherwise, True. If the specified control or at least one of its parents, the dxTryGetScaleFactorForControl function additionally returns the first found scale factor as the AScaleFactor parameter.

See Also