Vcl.Controls.TWinControl.DisableAlign

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DisableAlign; inline;

C++

void __fastcall DisableAlign();

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TWinControl

Description

Disables the realignment of child controls.

Call DisableAlign to temporarily prevent child controls from realigning. For example, while performing multiple manipulations of controls, such as reading from a form file or scaling, performance improves if child controls are not realigned until all manipulations are complete. The EnableAlign method restores normal child realignment.

Every call to DisableAlign must be followed by a matching call to EnableAlign. If an exception could be raised after the call to DisableAlign, use an exception block to ensure that EnableAlign will always be called.

DisableAlign/EnableAlign call sequences can be nested. An internal counter records the level of nesting. As long as the counter is positive, realignment is disabled and the AlignDisabled property returns true. Once the counter returns to zero, realignment is enabled and AlignDisabled returns false.

See Also