RequireDerivedFormResource variable
When True every form must have a resource (e.g. a .res file). An exception is raised if the resource is missing when creating a form.
Declaration
RequireDerivedFormResource: Boolean = FalseDescription
The form resource is the .lfm file compiled into the executable
of your application. For this flag, it does not matter if it was compiled via
an .lrs file or via fpcres. The resource is
automatically loaded by TForm and its descendants when created
using the Create(Owner) method.
If the resource file is missing, there is something wrong with either a resource or the unit which contains the faulty form. If the flag is False, you will see a blank form and probably search a long time what is wrong. If you set this flag to True, you get an exception.
For creating forms without resources, you have 3 options:
- Create a TForm class (not a descendant).
- Construct your form using the CreateNew() constructor.
- It is also possible to disable the exception by setting the global variable RequireDerivedFormResource to False.
History: Before 0.9.31 there was no exception. Therefore some resource-less forms might use the standard constructor Create(Owner) and will now get exceptions. This change is Delphi compatible and compatible with TFrame and TDataModule components.
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
