Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
Try using mapcontrol.Refresh(esriViewDrawPhase.esriViewGeography, null, mapcontrol.Extent); – Michael Todd Feb 15 '11 at 22:20
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


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.