Re: Controling a component's subcomponents

From: Bruce Roberts (ber_at_bounceitattcanada.xnet)
Date: 05/26/04


Date: Tue, 25 May 2004 20:25:29 -0400


"Tom" <lala@lolo.com> wrote in message
news:c8nc2d$edj$1@apollon.grec.isp.9tel.net...
> You understood correctly what I wanted, but I cannot afford to write my
own
> descendants of TListView and TTreeView since they have to be compatible
with
> the ones given in Delphi. Otherwise that would be too easy ;o)

And what is wrong with easy? Perhaps I've misunderstood you, but what I
suggest is compatible with the Delphi components.

> If you have another idea (if it is possible ?...)

Years ago I worked with some code that overrode a form's message loop. You
might be able to do something like that. But be warned. Its ugly. Its messy.
Its prone to failure. And you really shouldn't do it.

The only other possibility that comes to mind is to have your component grab
and replace the values of the onClick events in the tree and list view and
daisy chain the calls. If you do this in the your component's Loaded routine
only if csDesigning isn't in ComponentState it might work out - although I'm
skeptical. If Loaded is still too early, you might have to post a user
defined message to your component in Loaded and use the message handler
(assuming, of course that your component has a message loop).