Skip to main content

TdxForm.ScaleFactorChanged(Integer,Integer) Method

Updates components on the form in response to its scaling factor changes.


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


Name Type
M Integer
D Integer


This procedure is automatically called every time the application accepts the WM_DPICHANGED system message accepting 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 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