Some components are included in the Delphi .Data properties, such TTreeNode, .Data property may be considered a pointer can point to any type or structure, to facilitate the subsequent operations.
But TMenuItem no .Data property, here are the easiest way to increase TMenuItem .Data property.
In front .pas file you want to use to write the following code
type // type is recommended after the beginning of the increase
TMenuItem = class (vcl.Menus.TmenuItem)
public
the Data: TCustomData; // data for the menu to increase property
end;
Note that this method can only be applied in the present cell (or present window), if used in a plurality of units, it is necessary to increase the above code in each cell.
----------------
Disclaimer: This article is CSDN blogger original article "Li Zhengji", following the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source and this link statement.
Original link: https: //blog.csdn.net/webouse/article/details/60954465