Example: there is a empty form that has an event: another form (from
LFM-file) to be loaded instead of this form by double-clicking on old
form at run time.

I tried several ways to do this, for example:
1.      File -> FileStream -> BinStream -> BinStream.ReadComponent(Form)
2.      ReadComponentResFile()

These methods have drawbacks:
a.      Double-clicking event from the old form doesn't disappear in new
b.      Need to register (RegisterClasses) for all the classes that are in
the new form. Parsing the LFM-file, you can get the names of classes
in the strings. What content should have a function "function
StringToClass(AStr: string): TClass", to be able to call
"RegisterClass(StringToClass(AStr))" ?

3.      File -> StringStream -> Reader -> Reader.ReadComponent -> 
InsertComponent
But my methods does not work. Could you please help me: how to load
Form from LFM-file at run time?

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to