Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Can't find MapFrame of GraphicsContainer in PageLayoutControl (C#) ?

$
0
0
Hi,

I am getting a problem: I added element (text, line) in a ActiveView.FocusMap of a PageLayoutControl, then all elements are showed in the MapFrame of PageLayoutControl.GraphicsContainer.

If I don't select elements (in MapFrame) I can find the MapFrame by the loop:

Code:

IGraphicsContainer graphicsContainer = myPageLayout.ActiveView.GraphicsContainer;
graphicsContainer.Reset();
IElement pElement = graphicsContainer.Next();
 while (pElement != null)
            {
                if (pElement is IMapFrame)
                {
                      // do something
                }
            }

But, when one element is selected by using "Select Elements" command, the program won't enter the "if" function (can't find MapFrame).

Are there anyone know how to get The MapFrame in this case ?

It's very urgent

Thank you very much !

Viewing all articles
Browse latest Browse all 1374

Trending Articles