private void axTOCControl1_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e)
{
esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone;
IBasicMap map = null; ILayer layer = null;
object other = null; object index = null;
this.axTOCControl1.HitTest(e.x, e.y, ref item, ref map, ref layer, ref other, ref index);
if (item == esriTOCControlItem.esriTOCControlItemLegendClass)
{
IFeatureLayer layerS;
layerS = layer as IFeatureLayer;
ILegendClass plc = new LegendClassClass();
ILegendGroup plg = new LegendGroupClass();
if (other is ILegendGroup)
{
plg = (ILegendGroup)other;
}
plc = plg.get_Class((int)index);
ISymbol pSym;
pSym = plc.Symbol;
ISymbolSelector pSymbolSelector = new SymbolSelectorClass();
pSymbolSelector.AddSymbol(pSym);
bool b = pSymbolSelector.SelectSymbol(0);
if (b)
{
plc.Symbol = pSymbolSelector.GetSymbolAt(0);
}
axMapControl1.ActiveView.Refresh();
axTOCControl1.Refresh();
}
}
ARCEngine中符号选择器的实现
最新推荐文章于 2021-04-20 19:45:44 发布