> I'm writing a component that creates other components on a form
> Does anyone know the 'best' method to get the component
> declaration in the form declaration
> It turns up in the DFM ok

The 'best' method is to use the IFormDesigner interface and call the
CreateComponent method. Something along the lines of:

var
  FormDesigner: IFormDesigner;
begin
  FormDesigner := DestForm.Designer as IFormDesigner;
  FormDesigner.CreateComponent(TEdit, DestForm, 20, 20, 120, 22);
end;

should create the new component, appropiate declatarions and the default
DFM stuff.

Cheers, Max.



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to