My system:
Windows XP sp 3
Lazarus 1.6.0
FPC: 3.0.0
Can anyone help me out on this:
procedure TForm1.Button1Click(Sender: TObject);
var
menuItem : TMenuItem;
begin
menuItem := TMenuItem.Create(PopupMenu1);
menuItem.Caption := 'Item added at ' + TimeToStr(now);
menuItem.OnClick := PopupItemClick;
//assign it a custom integer value..
menuItem.Tag := GetTickCount;
PopupMenu1.Items.Add(menuItem) ;
end;
procedure TForm1.PopupItemClick(Sender: TObject);
var
menuItem : TMenuItem;
begin
menuItem := TMenuItem(sender;
ShowMessage(Format('Clicked on "%s", TAG value: %d',[menuItem.Name, menuItem.Tag]));
end;
When compiling, this statement: menuItem.OnClick := PopupItemClick gives
the following error:
unit1.pas(43,23) Error: Wrong number of parameters specified for call to "MenuItem1Click"
Think I've done according to cook-book, but what is wrong?
