How to load form from a DFM file at runtime in Delphi

It's very simple. Just drop TFormSaver component onto your form, set DataFormat property and call the LoadFromDFM method.


Also you can load form from stream with LoadFromStream method.


Please be sure that all the loaded types are registered with standard RegisterClasses procedure or with RegisterTypes method of TFormSaver component that register all the classes used in the owner form.

See also
Form Saver
Components for Delphi / C++ Builder
Howtos for Programmers