Table of Contents

TTMSFNCCustomControlBaseCommon Class

Lowest-level visual control base class with DPI scaling, style adaptation, alignment, and drag-and-drop file acceptance.

API unit family: TMSFNCCustomControl Inherits from: TControl Implements: ITMSFNCAdaptToStyle, ITMSFNCProductInfo, ITMSFNCShortCutHint

Syntax

TTMSFNCCustomControlBaseCommon = class(TControl, ITMSFNCAdaptToStyle, ITMSFNCProductInfo, ITMSFNCShortCutHint)

Properties

Name Description
AllowFocus When True (default) the control can receive keyboard focus. Set to False to prevent focus.
ControlAlignment Framework-neutral alignment that positions the control relative to its parent. Defaults to caNone (manual placement).
DesigntimeFormPixelsPerInch Pixels-per-inch value of the form as recorded at design time. Used internally to compute DPI scaling at runtime.
PaintScaleFactor DPI scale factor applied during painting. Use ScalePaintValue to convert pixel sizes in custom drawing code.
ResourceScaleFactor DPI scale factor applied when loading image resources (bitmaps). Use ScaleResourceValue to convert pixel sizes for resource loading.

Methods

Name Description
GetControlMargins Returns the four margin values of the control.
ScalePaintValue Scales an integer value by the current paint DPI factor, returning the scaled integer.
ScaleResourceValue Scales an integer value by the current resource DPI factor, returning the scaled integer.
SetControlMargins Sets the four margin values of the control in one call.