Board index » delphi » Novice Needs help From Pros

Novice Needs help From Pros

Hi

Let's say I was creating a component that was deriverd from TRichEdit and I had
a property that I wanted monitored with every change that went on in the
RichEdit Control so that the effects ot the properties attributes would be set
with every change of the control.

How and where do you implement this?
I do want the property Published.

I guess what I'm asking is where does Delphi look when it wants to update
properties like this?

I'm using Delphi 3 Standard edition

Any help appreciated:)

 

Re:Novice Needs help From Pros


On 24 Jan 1999 17:13:18 GMT, nol...@aol.com (NolenJ) wrote:

Quote
>Let's say I was creating a component that was deriverd from TRichEdit and I had
>a property that I wanted monitored with every change that went on in the
>RichEdit Control so that the effects ot the properties attributes would be set
>with every change of the control.

>How and where do you implement this?
>I do want the property Published.

>I guess what I'm asking is where does Delphi look when it wants to update
>properties like this?

There are two approaches you might take.

TRichEdit is derived, through a couple of intermediate steps, from
TCustomEdit.  TCustomEdit has a protected virtual (dynamic, actually,
but that's not important) procedure called Change, which is called
whenever the contents or formatting of the text change.  You could
override procedure Change to update your property.

The other approach is not to store the value of your property at all,
just recalculate it any time it's requested by the 'get' function.

--
Report all {*word*201} mail to your Potsmaster.

Other Threads