Your solution works. FYI, this is on a TreeView control. However, this
causes the content menu to be displayed whenever there is a right click on
the control. I need to have the context menu displayed when the user right
clicks on certain types of nodes in the TreeView. That is why I trapped the
MouseUp event so I can test which node they have clicked on and determine
whether to display the context menu.
Is there a way to cancel the PopuUp event so I could achieve this
functionality?
Thanks,
Chris
Ian Cooper said:
Don't use the MouseUp event. Instead set the ContextMenu property of the
control; the popup event fires and then your message box is displayed.