HOW TO
Instructions provided describe some sample code to remove a data frame from the page layout by calling the IGraphicsContainer::DeleteElement() method.
Code:
Dim pMap As IMap = pMapDoc.Map(0)
Dim pContainer As IGraphicsContainer = pMapDoc.PageLayout
Dim pMapframe As IMapFrame = pContainer.FindFrame(pMap)
pContainer.DeleteElement(pMapframe)
Code:
IMap pMap = pMapDoc.get_Map(0);
IGraphicsContainer pContainer = (IGraphicsContainer)pMapDoc.PageLayout;
IMapFrame pMapframe = (IMapFrame)pContainer.FindFrame(pMap);
pContainer.DeleteElement((IElement)pMapframe);
Code:
IMap pMap = pMapDoc.getMap(0);
IGraphicsContainer pContainer = (IGraphicsContainer)pMapDoc.getPageLayout();
IMapFrame pMapframe = (IMapFrame)pContainer.findFrame(pMap);
pContainer.deleteElement((IElement)pMapframe);
Get help from ArcGIS experts
Download the Esri Support App