Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当弹出菜单已经弹出时,我需要TMenuItem在 Delphi 7中更改 a 的文本。
TMenuItem
我的弹出菜单有
OwnerDraw := true;
我想使用:
popupmenu.repaint();
或者
popupmenu.refresh();
但它们不存在。我该怎么做?
您可以调用MenuChanged菜单项以强制对其进行更新。这是一个受保护的成员,您需要通过众所周知的受保护成员黑客来访问该成员。
MenuChanged
type THackedMenuItem = class(TMenuItem); .... THackedMenuItem(MyMenuItem).MenuChanged(True);//forces redraw of owner drawn item