生成的代码如下:
PopUpitem:=TMenuItem.Create(Self);
PopupItem.Caption:='XXX';
PopUpItem.GroupIndex:=0;
PopUpItem.OnClick:=OcbPopupHandler;
Mnupop.Items.Add(PopupItem);
调用的例子如下:
procedure TFrmMain.OcbPopupHandler(Sender: TObject);
begin
if (sender as TMenuitem).GroupIndex=0 then
begin
....
end;
end;