To have a context menu appear only for a single control then set the control's ContextMenu
property. If you set the form's ContextMenu
property then it applies to the entire form. It sounds like you might have associated it with the form as well.
PopMenu pops up anywhere the user right clicks on the form. VS2019 C#.
Olaf Berg
21
Reputation points
Hi,
I have this PopMenu control(Winform) which works as expected. The problem is that it pops up on whatever place on the form the user right clicks, but the ObjectListview CellRightClick event isn't fired in such a situation. And it shouldn't.
How do I get the menu to appear only when right clicking occurs on the listview control?
The listview's property named ConTextMenuStrip is set to the name of the ContekxtMenuStrip control, which is named
PopUpMenu.
Accepted answer
-
Michael Taylor 48,576 Reputation points
2021-10-27T17:39:17.247+00:00