Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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,

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
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 '12 at 3:40
    
Hi blah238. I can do now, I used another statement : graphicsContainer = PageControl.PageLayout as IGraphicsContainer –  taibc Nov 14 '12 at 4:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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