Now i know that the article is about .net and C#, but was wondering if this
could be done in Delphi. as this could help me no end if it could be done.
I am using Delphi7.
Thanks in advance
Darren
> Now i know that the article is about .net and C#, but was wondering if this
> could be done in Delphi. as this could help me no end if it could be done.
It can't be done cleanly (the way .net does it the new properties appear
in the inspector as properties of the original control)
The only way I know of doing this is to create a component which has
collection of controls which it should link up.
For example:
type
TProviderItem = class(TCollectionItem)
published control:TWinControl;
published color :TColor;
end;
Then in the IDE you would have to bring up the collection editor for your
provider component and create an item for each control.
At run-time you would have to link the OnEnter and OnExit events for the
controls. YOu have to make sure that your event handlers call the
original event handlers.
This is pretty much what the .NET version does except for the way .NET
integrates the properties into the property list.
One caveat with Delphi is that events are only single cast so you need to
hope that noone else changes the event after you have got to it.
Marc
Marc