刚想实现删除axMapControl 中指定的元素。实现该功能首先得获取欲删除的Element。
下面代码为遍历方式获取其中的Element
IGraphicsContainer pGrappic=axMapControl1.Actiview as IGrapicsContainer IElement pElement = pGraphic.Next();
IGraphicsContainer 还提供了交互式的获取Elments,其中包括以point的选的 pGraphic.LocateElements和以Envelope 选的pGraphic.LocateElementsByEnvelope。
此为第一种方式。即需人际交互式。
第二种方式为: 在创建Element的时候指定Element的名字,删除的时候删除指定的名称的Element的
IElement pElement = pGraphic.Next(); while (pElement != null) { IElementProperties pd = pElement as IEleme