2

I have a PagelayoutControl with the name: PageControl. And I added a text element into MapFrame (FocusMap) of the PagelayoutControl. If the text element and MapFrame are selected (by using the button "Select Elements" on the toolbar).

Do you know are there any ways to unselect the elements and MapFrame by using code in C# ?

Please see my screenshots (in cases: selected and unselected)

enter image description here

enter image description here

Thanks and regards,

1 Answer 1

2

QI from IMapFrame.Map to IGraphicsContainerSelect and call its UnselectAllElements or UnselectElement methods.

2
  • Thank you. But when elements are selecting. I can't find the MapFrame object of PageLayoutControl. I use the statement: IElement pElement = graphicsContainer.Next(); to find elements. (with graphicsContainer = pageControl.ActiveView.GraphicsContainer;)
    – taibc
    Nov 14, 2012 at 3:40
  • Hi blah238. I can do now, I used another statement : graphicsContainer = PageControl.PageLayout as IGraphicsContainer
    – taibc
    Nov 14, 2012 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.