[Lazarus] Menu Click Event in Runtime

Marcos Douglas md at delfire.net
Fri Apr 29 19:47:34 CEST 2011


2011/4/29 Rogério Martins <rogmartins at gmail.com>:
> Hi !
>
> How do i make an assignment between a TMenuItem.OnClick event and the
> procedure xyz (Sender: TObject)  at runtime ?
>
> In Delphi i just do:
>
> menuItem.OnClick := MenuClick;
> where procedure declaration is procedure MenuClick(Sender: TObject);
>
> In lazarus, this code does not compile.
>
> How do i correct this ?

Use:
menuItem.OnClick := @MenuClick;

Marcos Douglas




More information about the Lazarus mailing list