Search code examples
delphi-2010datamoduledelphi

TDataModule inheritance


When I'm trying to inherit TDataModule Delphi treat descendant class like a form giving them properties like font and Client properties. ("property does not exists" exception on a run-time)

TixDataModule = class(TDataModule);

TDM = class(TixDataModule)
end;

What Can I do to make it work?


Solution

    1. As TixDatamodule is just a synonym for TDatamodule, you can inherit directly from TDataModule
    2. If you really want to inherit from TixDataModule, then put TixDataModule in a separate unit, with its own .dfm.