Back

LL074

UI component created in constructor

Object Pascal — Delphi & Free Pascal
Info
Delphi

Creating UI controls in constructors bypasses the form designer and complicates layout

creating UI controls in constructors bypasses the form designer and complicates layout.

Why this severity

creating UI controls in constructors bypasses the form designer and complicates layout.


Known false positives

dynamically generated UI where components must be created at runtime.

Remediation example

// Place TButton on the form via the designer
// and configure it in Object Inspector instead
// of calling TButton.Create in the constructor.

Reconnecting… Connection lost. Reload