当然你也可以这么写
procedure TForm1.menuitemclick(sender: tobject);
begin
if sender is TMenuItem then
showmessage('click '+(sender as TMenuItem).Caption);
end;
procedure TForm1.createmenuitem;
begin
Menu1.Add(NewItem('aa', 0, False, True, menuitemclick, 'mnuAA'));
Menu1.Add(NewItem('bb', 0, False, True, menuitemclick, 'mnuBB'));
end;