HowTo:  Remove a data frame from a map document using ArcObjects

相关信息
Article ID: 40778
Software:
ArcObjects SDK for the Microsoft .NET Framework 10.0, 10.1
ArcObjects SDK for Java Windows 10.0, 10.1
Platforms:
Windows Windows 7

问题描述
Instructions provided describe some sample code to remove a data frame from the page layout by calling the IGraphicsContainer::DeleteElement() method.
已邀请:

易智瑞技术支持

赞同来自:

解决方案

    • [VB.NET] 

    Dim pMap As IMap = pMapDoc.Map(0)
    Dim pContainer As IGraphicsContainer = pMapDoc.PageLayout
    Dim pMapframe As IMapFrame = pContainer.FindFrame(pMap)
    pContainer.DeleteElement(pMapframe)
     
    • [C#] 

    IMap pMap = pMapDoc.get_Map(0);
    IGraphicsContainer pContainer = (IGraphicsContainer)pMapDoc.PageLayout;
    IMapFrame pMapframe = (IMapFrame)pContainer.FindFrame(pMap);
    pContainer.DeleteElement((IElement)pMapframe);

    • [JAVA] 

    IMap pMap = pMapDoc.getMap(0);
    IGraphicsContainer pContainer = (IGraphicsContainer)pMapDoc.getPageLayout();
    IMapFrame pMapframe = (IMapFrame)pContainer.findFrame(pMap);
    pContainer.deleteElement((IElement)pMapframe);

    其它相关参考
    1. IGraphicsContainer.DeleteElement Method


    创建及修改时间
    Created: 12/26/2012

    Last Modified: 1/17/2013
    原文链接
    http://support.esri.com/en/kno ... 40778

    要回复问题请先登录注册