示例:从GraphicsContain中取出一个元素

示例:从GraphicsContain中取出一个元素

通过名字查找要素

    使用Name属性可以指定加入到Graphics Container中的元素名字,这样做的目的是便于以后通过名字来找到相应的元素。

Dim pElementProps As IElementProperties
Set pElementProps = pGContainer.Next
Do Until pElementProps Is Nothing
    IF pElementProps.Name = "LoganMap-Legend" Then
        Dim pLegendFrame As IMapSurroundFrame
        Set pLegendFrame = pElementProps
'QueryInterface(QI)
        Exit Do
    End IF
    Set pElementProps = pGContainer.Next
Loop

原文地址:https://www.cnblogs.com/lauer0246/p/1096350.html