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 am running my map in dynamic display mode, and I want to programmatically uncheck a layer that is not a IDynamicLayer that is visible in the AxTocControl -- its just a regular layer file.

I thought that layer.Visible = false; with a map refresh would work, but bafflingly it does not.

I'm using ArcEngine 10 VS2010 & C#

share|improve this question
    
Have you set its buddycontrol to be the map control? –  MathiasWestin Feb 15 '11 at 21:54
    
There's refresh and then there's refresh; how are you refreshing the map? –  Michael Todd Feb 15 '11 at 21:55
    
@MathiasWestin yes, I set it to my AxMapControl, like this: toolbarControl.SetBuddyControl(mapControl); –  patrick Feb 15 '11 at 22:02
    
@Michael Todd mapcontrol.Refresh() –  patrick Feb 15 '11 at 22:03
1  
Try using mapcontrol.Refresh(esriViewDrawPhase.esriViewGeography, null, mapcontrol.Extent); –  Michael Todd Feb 15 '11 at 22:20

1 Answer 1

up vote 1 down vote accepted

Look at the samples: Layer property page and property sheet you need to use ActiveView.ContentsChanged to refresh the TOC when working with layer visibility.

share|improve this answer

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.