开发者

Stop VCL Child Controls from Inheriting Parent Popup Menu

开发者 https://www.devze.com 2022-12-27 07:22 出处:网络
I have a Delphi 2007 VCL TPanel with a TPopupMenu assigned to it. There are some TEdit controls on the panel.The edits inherit the popup menu of the parent panel.I want to not allow this popup inherit

I have a Delphi 2007 VCL TPanel with a TPopupMenu assigned to it. There are some TEdit controls on the panel. The edits inherit the popup menu of the parent panel. I want to not allow this popup inheriting, so the edits will show the default Windows TEdit popup menu with Copy, Cut, Paste, etc., but have not found a way to do it yet. There doesn't appear 开发者_StackOverflowto be a "ParentPopupMenu" type property to set which controls inherit it from the parent component.


Try setting the PopupMenu's AutoPopup property to False, and then manually Popup() the menu when needed, since as in the TPanel's OnContextMenu event.


This is QC#54286: Parent-PopupMenu overrides standard context menu. Andreas Hausladen's VCL Fix Pack fixes the issue so it works the way you're expecting it to.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号