Now that I've woken up (yawn) I have to reply to two posts in one.
1/ Neven. Your solution is a good one. I do agree. I disagree that it was a good answer only :) based on the question asked. From the samples given etc of source, I would think that your solution did not solve the question appropriately based on the coding style and requirements of the query. 2/ Dennis. You said the first bit is a hack. Well I don't see that you used any blunt instruments in getting access to protected properties. Just a little cheating. The control adaptor is also a good solution to a problem. But in this case it also is not a good answer because: A/ who said anything about it coming from Tcontrol? Only that it would have a color property. B/ you failed to mention that in this case you would then also have to create adaptors for every other case available which wasn't a control. C/ when creating the adaptors in the first place to put in the list, you would then also have to have a big if statement testing which class you are creating an adaptor for. (no better than the original if statement), or you would need a dymamic generation of classes against class adaptors, Which would need to be implemented somewhere. The question was a simple one. Given an object of unknown class, how do you change the color property? While interfaces are cool, and adapters are neat. None of them actually answered the question within the standard potential of a delphi object. Hopefully they give everyone who didn't know of these options more insight. As I say, cats can be skinned nine times, then you get another cat :) -----Original Message----- From: [EMAIL PROTECTED] [mailto:owner-delphi@;delphi.org.nz] On Behalf Of Neven MacEwan Sent: Thursday, 24 October 2002 8:14 a.m. To: Multiple recipients of list delphi Subject: Re: [DUG]: Polymorphic assignment to Color - How? (sometime it's a Property, sometimes not) Kyley I did put '' around correct for a reason :-) Neven --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/