下面的代码实现了右键图层功能代码,可是我想添加一个右键可以打开属性(AttributeTable),
也就是右键分别打开每个图层的属性,可以这个键里面的代码不会写,希望高手帮帮忙。
private void axTOCControl_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e)
{
//toc右键菜单
tocMenuItem = new QuerySystem_V0._1.TOCMenuItem(this);
esriTOCControlItem toccItem = esriTOCControlItem.esriTOCControlItemNone;
ILayer iLayer = null;
IBasicMap iBasicMap = null;
object unk = null;
object data = null;
if (e.button == 2)
{
axTOCControl.HitTest(e.x, e.y, ref toccItem, ref iBasicMap, ref iLayer, ref unk, ref data);
tocMenuItem.Map = iBasicMap as IMap;
tocMenuItem.Layer = iLayer;
if (toccItem == esriTOCControlItem.esriTOCControlItemLayer)
{
tocMenuItem.Show(axTOCControl, new System.Drawing.Point(e.x, e.y));
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货