Adding published properties to forms and datamodules (Views: 102)
When I add published properties to a form / datamodule decendent, what don't I see them is the object inspector?
In order to see properties of decendent forms / datamodules in the object inspector, we need three actions:
1. Define the property as published, with a type the object inspector can handle. Note that the object inspector does not handle interface types (in delphi 5).
TMyForm = class(TForm)
property MyProp: Integer;
2. Add a register procedure to some unit ( I recomend another unit, that will be included only in design-time package ).
// for TForm decendents:
// for TDataModule decendents:
the class TDataModuleDesignerCustomModule is in the DMDesigner unit, for which we have no source. The unit is in the dsnide50.bpl. In order to use this unit we have to include the dsnide50.bpl package in our's package 'Requires'. As this package is used only by the delphi IDE, I recommend to add it only to a design-time packages.
3. Compile and install the new package. Now we will see the new property in the object inspector.
<< Back to main page