简体   繁体   中英

How to disable a contextmenu for a panel

I have two panels - panel1 and panel2

I want my context menu to only work for panel1 but not panel2.

How would I do this?

set the panel's context menu to null

panel1.ContextMenu = null;   

if you want to a panel that have context menu, you should set your context menu to that panel . so if you don't want the context menu on that panel, just don't set it .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM