当前位置: 代码迷 >> Delphi >> incompatible types:‘tnotifyevent’and'string'该如何处理
  详细解决方案

incompatible types:‘tnotifyevent’and'string'该如何处理

热度:1261   发布时间:2016-05-05 01:19:03.0
incompatible types:‘tnotifyevent’and'string'
脚本事件处理函数出错:unit1.pas{32}:incompatible types:‘tnotifyevent’and'string'
下面是源码:
var
b: TButton;
Form1: TForm;
procedure ButtonClick(Sender: TButton);
begin
ShowMessage(Sender.Name);
end;
begin
b := TButton.Create(Form1);
b.Parent := Form1;
b.OnClick := @ButtonClick; // same as b.OnClick := 'ButtonClick'
b.OnClick := nil; // clear the event
end.

刚接触delphi  实在解决不了  求各位解决啊!!!
脚本

------解决方案--------------------
procedure ButtonClick(sender:TObject);

b.OnClick := Self.ButtonClick
  相关解决方案