Board index » delphi » Form1.MenuItem5Click( SENDER ??? )

Form1.MenuItem5Click( SENDER ??? )

Form1.MenuItem5Click( SENDER ??? )

How can I reuse the code in MenuItem5Click below.
What do I use as the parameter Sender.

MenuItem5 : tMenuItem ;

Form1.MenuItem5Click( Sender : tObject );
begin
  { code I want to reuse. }
end ;

proc AnotherProc ;
begin
  ...
  Form1.MenuItem5click( xxx ) ;
  ...
end ;

Can I put Form1.Handle as xxx.
What is the logic of this.

Plese e-mail your response to me and consider posting it too.

Thanks, Andrew
Melbourne Australia.

 

Re:Form1.MenuItem5Click( SENDER ??? )


Quote
Andrew Gunner wrote:
> Form1.MenuItem5Click( Sender : tObject );
> begin
>   { code I want to reuse. }
> end ;

> proc AnotherProc ;
> begin
>   ...
>   Form1.MenuItem5click( xxx ) ;
>   ...
> end ;

use nil

ie:

Form1.MenuItem5Click(nil)

These lines are included so my stupid NNTP server thinks I'm sending more than
what I've included from the original message.

Dave

Other Threads