Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

dxTryGetScaleFactorForControl(TControl,TdxScaleFactor) Method

Attempts to retrieve the specified control‘s scale factor.

#Declaration

Delphi
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