How do I programatically add actions to an Action Manager in Delphi 2010
问题 I am trying to dynamically add actionitems, I can add the item and it works when I do this: HostActionItem := ActionManager.ActionBars[0].Items[0].Items[2]; NewItem := HostAction.Items.Add; NewItem.Action := MyActionToPerform; NewItem.Caption := Description; NewItem.ImageIndex := 1; NewItem.Tag := 13; However, when the action Execute method fires I attempt to get the ActionComponent from the Sender object like this: if (Sender is TAction) then tag := (Sender As TAction).ActionComponent.Tag;