开发者

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?


Make sure that all the inherited components is marked with inherited rather than object in the in the dfm.

Toggle "dfm as text" and "dfm as visual" with Alt+F12.


  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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜