Method pointer and regular procedure incompatible

后端 未结 5 851
谎友^
谎友^ 2020-12-14 03:27

I have an app, which has multiple forms. All these forms have a PopupMenu. I build the menu items programatically, all under a common root menu item. I want ALL the menu

5条回答
  •  死守一世寂寞
    2020-12-14 04:00

    This is the difference between a "procedure" and a "procedure of object"

    The OnClick is defined as a TNotifyEvent:

    type TNotifyEvent = procedure(Sender: TObject) of object;

    You cannot assign a procedure to the OnClick as it is the wrong type. It needs to be a procedure of object.

提交回复
热议问题