In vb.net (2008), I want to be able to control when a contextMenuStrip (context menu) is displayed. I don't want it to always appear when the right mouse button is clicked...only when certain criteria within my program are met. I figure I would use addHandler but I'm not exactly clear on how to completely control the opening of the contextMenuStrip. I know I would issue a call to the "open" method to render the contextMenuStrip. However, I am unclear as to how to completely take over control of when to render the contextMenuStrip.
+1
A:
You need to set the control's ContextMenuStrip property to null, then handle the MouseClick event and call the ContextMenuStrip's Show function, passing the control and e.Location
.
SLaks
2010-04-09 14:30:51