[Lazarus] TStringList as published property of a component

Alberto Manganaro alberto.manganaro at unimib.it
Thu Nov 18 11:00:43 CET 2010


Hi,

first of all, as it's the first time I write here, I'd like to thank all 
the people involved in the development/testing/mantaining/etc of Lazarus :-)

I would like to understand better how to deal with the properties of a 
visual component. My problem is the following: I'm writing a component 
that has a property of class TStringList. This property is published, so 
I can correctly access at design-time when I put my new component in a 
form. But if I assign some values to the TStringList at design-time, it 
seems that at run time that string list is empty.

Now, if I initialize that list through code (it means that I do this run 
time, after the component is created) everything is fine. My doubt is 
that in the constructor of the component the string list is created and 
initialized, so maybe this is the problem. But if I don't create the 
string list in the constructor of the component, of course I have an error.

Can someone please explain me how properties of a component are managed 
at design-time? How can I set my string list at design-time and 
correctly have the values available at run-time?

Thanks!

A.

-- 
Alberto Manganaro

Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca P.zza della Scienza, 1
20126 Milano - Italy

http://michem.disat.unimib.it/chm/




More information about the Lazarus mailing list