[DUG] Comopnent question

Paul Eggleton paule at cjntech.co.nz
Wed May 24 10:26:04 NZST 2006


Robert Martin wrote on Wednesday, 24 May 2006 10:21 a.m.:
> Heres a real simple one but its driving me mad....
> 
> I have a component with a TStrings published property as follows.
> 
>     property SQLSearchString : TStrings read fSQLStrings write
> SetSQLStrings;
> 
> However whenever I change the .Text property of the TStrings the
> SetSQLStrings does not seem to fire.  I'm no component guru, what am I
> doing wrong ?

You're not really doing anything wrong, it's just that the SetSQLStrings
method is only going to be called when you actually assign a value to
the property. Changing the Text property of the Tstrings doesn't do
that, it's just modifying the object. If you use a TStringList, it has
OnChange and OnChanging events that you can set up to do what you want.
Make sure also that your SetSQLStrings uses .Assign and not := to change
the value of the fSQLStrings as well (I presume you are already doing
this).

Cheers,
Paul

---------------------------------------------------------
Paul Eggleton                  Ph:    +64-9-4154790
Software Developer             Fax:   +64-9-4154791
CJN Technologies Ltd.          DDI:   +64-9-4154795
http://www.cjntech.co.nz       Email: paule at cjntech.co.nz
---------------------------------------------------------



More information about the Delphi mailing list