AnsweredAssumed Answered

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

Question asked by taibc on Feb 17, 2013
Latest reply on Mar 2, 2013 by taibc

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:

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 !