TMenuItem is a TComponent, i.e. It is not a window control and does not have classic events. Instead, click events that occur in the real window control are delegated to the TMenuItem instance. I do not know which window control is the real host for events, but even if I did, it would be difficult for me to determine which TMenuItem corresponds to the actual click point.
My advice is to make a highlighted window for editing the menu using the tree control, which generally fills its elements at runtime based on the actual layout of the menu, and then provides on / off options for tree nodes that reflect the corresponding menu items. Then you can save / load menuitem list etc. It should be much cleaner and easier than diving into the muddy depths of VCL and computing (and redefining) how events propagate from "real" controls to design-time representations called TComponent s ...
source share