Thank you. Vào 18-10-2015 22:11, "Mattias Gaertner" <[email protected]> đã viết:
> On Sat, 17 Oct 2015 15:18:12 +0700 > Kiên Nguyễn Tiến Trung <[email protected]> wrote: > > > I have been successful to save a component to a text file. However, I > have > > a problem while reading them back. > > > > To illustrate, this is the text file created by saving the components. > > > > object Parent1: TParentClass > > Child = Child > > Value = 54 > > Str = 'SP' > > List.Strings = ( > > 'PV' > > ) > > object Child: TChildClass > > Value = 85 > > Str = 'WO' > > List.Strings = ( > > 'QL' > > ) > > end > > end > > > > When I load the component Parent1 using this file, properties Value, Str, > > and List are loaded successfully. *However, the property Child is not > > loaded.* > > Actually it is created and loaded. > > > > It seems that there is a TChildClass object created and then increases > the > > ComponentCount of Parent1. But it is not what I want. I want the property > > Child be loaded instead of creating a new object. > > If I remember correctly you need > > Child.ComponentStyle:=Child.ComponentStyle+[csSubComponent]; > > > Mattias > > -- > _______________________________________________ > Lazarus mailing list > [email protected] > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus >
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
