在ArcObject应用程序开发中,TOC控件和Map控件是绑定的,map对象修改后,TOC中的图层自动刷新,但在Add In开发中,TOC的内容不会自动刷新,需要手动刷新,操作方法如下:
IDocument document = ArcMap.Application.Document; IMxDocument mxDocument = (IMxDocument)document; IContentsView contentsView = mxDocument.CurrentContentsView; contentsView.Refresh(null);