TOCControl 的HitTest()方法l

public void HitTest ( int X, int Y, ref esriTOCControlItem ItemType, ref IBasicMap BasicMap, ref ILayer Layer, ref object Unk, ref object Data );

各参数的含义如下:

X,Y :鼠标点击的坐标;

ITemType: esriTOCControlItem枚举常量

BasicMap:绑定MapControl的IBasicMap接口

Layer:被点击的图层

Unk:TOCControl的LegendGroup对象

Data:LegendClass在LegendGroup中的Index。

 

esriTOCControlItem枚举常量用于描述TocControl上的Item的类型,其定义如下:

esriTOCControlItemNone      0      没有对象

esriTOCControlItemMap        1      Map对象

esriTOCControlItemLayer      2      Layer对象

esriTOCControlItemHeading      3      对象的标题

esriTOCControlItemLegendClass   4      LegendClass对象

原文地址:https://www.cnblogs.com/DayDreamEveryWhere/p/2438630.html