Skip to main content
A newer version of this page is available. .

TdxCustomForm.ScaleFactorChanged(Integer,Integer) Method

Allows you to respond to the form’s scaling factor changes.

Declaration

procedure ScaleFactorChanged(M: Integer; D: Integer); virtual;

Parameters

Name Type
M Integer
D Integer

Remarks

This procedure is automatically called every time the application receives the WM_DPICHANGED system message, and the Scaled property is set to True. The ScaleFactorChanged procedure accepts the new form scaling factor’s numerator and denominator values as the M and D parameters, respectively.

This procedure calls the UpdateImageLists procedure to implement the form’s capability to dynamically switch between several image lists containing UI icon sets designed for different target DPI values.

You can override the ScaleFactorChanged procedure in a descendant form to perform a set of custom actions when the ScaleFactor property value changes. Call UpdateImageLists within the custom ScaleFactorChanged procedure implementation to retain the form’s capability to automatically choose between specially prepared UI icon lists when the monitor DPI changes.

Refer to the Preparing and Managing UI Icon Lists topic for detailed information on overriding and using the ScaleFactorChanged procedure.

See Also