ILayer.Visible seems to have no effect - How can I manually manage layer visibility and actually get the map control to update?

ILayer lyr = mapControl.get_Layer(i);

//this works for custom layers that I define but not for Bing_Maps.lyr or ESRI .lyr files that comes with ArcEngine or connections to ArcGIS Online. For composite layers, I also tried iterating through sub layers and setting the visibility to false

lyr.Visible = false;
  • 2
    are you refreshing or partially refreshing the active view's display? By "manually" do you mean programmatically? Jan 19, 2011 at 1:01
  • Can you share your code? ILayer.Visible Property is the one which is used for this, & is working for me. Jan 19, 2011 at 3:48
  • edited code formatting
    – Petr Krebs
    Jan 19, 2011 at 15:59
  • I added more code and a better description to answer your questions. I did see another post about ILayerFile and noticed that this interface has no visibility property - would it have anything to do with that?
    – Darren
    Jan 24, 2011 at 21:35
  • I experienced problems with layer visibility while using the DynamicDisplay functionality.
    – patrick
    Jun 14, 2011 at 16:36

2 Answers 2


If the layer is added to a basemap layer you need to Notify the baselayer that a layer has changed to ensure that it recreate it's display cache: Accessing a basemap sublayer


If you're using a ITOCControl, you can take a look at this featureITOCControl.LayerVisibilityEdit Hope this helps

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.