AutoScale Property (AForm)

Version 6, Version 14 (2025)

 

Returns or sets whether the form adjusts its size and scales its controls at run-time base when the System DPI setting is changed effected by the Windows Display Scale settings or when the form font size is changed .

Syntax

[ bAutoScale = ] Object.AutoScale

The AutoScale property syntax has the following parts:

 

Name

Type

Description

Object

AForm

AForm object

bAutoScale

Bool

True for automatic scaling - Default value is False.

Comments

You can use this property to allow your form and its controls to automatically adjust their size based on the Windows Display Scaling settings (v14 2025) or when the Form.Font.Size is changed. This will prevent clipping of control's text when sizing the form. Usually this property is set from the Form's Properties Window at the design time and set to False only if you want to control the font sizing manually to respond to Display Scaling changes.

Example

The following statement sets the auto scale property on Resize (event) of a form:

! rescale form by changing its font's size

if IsTouchScreenEnable()

if NOT frm.AutoScale

frm.AutoScale=True

frm.Font.Size=16

endif

endif

Applies to

AForm

See Also

AFont