Board index » delphi » How to let a form call a placed component's method

How to let a form call a placed component's method

Hello,

I've made a component which has a procedure called SaveSettings. I would
like to place this component on a form and do nothing else with it (no code
should have to be added to the form). Is it possible to let the parent form
call this SaveSettings method for example when the form closes?

This should all happen without adding code to the form and without using a
handler like OnClose, since this could be used by the form already. Can it
be done via a Message handling (WM_CLOSE message or so).

Thanks

Roy

 

Re:How to let a form call a placed component's method


You don't need to to use any messages or code in your form.
Just call your SaveSettings procedure in your components destructor.
The components destructor will automatically be called when the form is
destroyed, so this is the place to do it.

Roy Rutten <no.junkmail.roy.rut...@xarmac.nl> skrev i en
nyhedsmeddelelse:7v3ufk$o1...@reader1.wxs.nl...

Quote
> Hello,

> I've made a component which has a procedure called SaveSettings. I would
> like to place this component on a form and do nothing else with it (no
code
> should have to be added to the form). Is it possible to let the parent
form
> call this SaveSettings method for example when the form closes?

> This should all happen without adding code to the form and without using a
> handler like OnClose, since this could be used by the form already. Can it
> be done via a Message handling (WM_CLOSE message or so).

> Thanks

> Roy

Other Threads