You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects General forum

trap the OnContextMenu events for the table...   Dominic Lavoie May 27, 2004
Re: trap the OnContextMenu events for the t...   Wm Matthew Cushing Apr 27, 2005
Re: trap the OnContextMenu events for the t...   Kirk Kuykendall Apr 27, 2005
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject trap the OnContextMenu events for the table of contents 
Author Dominic Lavoie 
Date May 27, 2004 
Message Hi,

I would like to trap the onContextMenu events when a user do a right-clic with the mouse on the table of contents.

The goal of the fonction is to not allowed the possibility to open the attribute table for a certain featurelayer. When the user right-clic on the table of contents, I will check what is the name of the selected layer, and if it's the concerned layer, I will removed the open attribute table from the context menu

Thanks everybody for your help.

Dominic Lavoie
Ville de Laval 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: trap the OnContextMenu events for the table of contents 
Author Wm Matthew Cushing 
Date Apr 27, 2005 
Message Any luck with this, I am currently attempting the same thing.

Thanks
Matt 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: trap the OnContextMenu events for the table of contents 
Author Kirk Kuykendall 
Date Apr 27, 2005 
Message The only way I know of doing this is to subclass IContentsView.hWnd and trap the WM_RBUTTONUP message.

I think the layer gets selected in the WM_MOUSEDOWN event, so by the time you get a mouseup IMxDocument.SelectedItem should already be set to whatever the user has clicked on.

google for subclassing windows for more info. 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
http://www.ambergis.com
Now Answering questions at:
http://gis.stackexchange.com/