Prevent popup of contextmenu

  • Thread starter Thread starter Roland Wolters
  • Start date Start date
R

Roland Wolters

Hi,

My treeview has a contextmenu. Using this menu the user can perform an
action on a node.
However, sometimes I do not want the contextmenu to popup. So I catch the
treeview_popup event, check if the contextmenu is to be shown, and show it
(or not). The only thing working here is to dispose the contextmenu but
then it will never be shown again (since it is disposed).

What is the way to do this?


Thanx,

ROland
 
I have, in a different situation, saved the context menu away in
another variable, like this.savedContextMenu = myControl.ContextMenu,
then set .ContextMenu = null. Then, later, when it is valid to show the
context menu again, I just reassign myControl.ContextMenu =
this.savedContextMenu.
 
Back
Top