Tuesday, 23 April 2019

arcgis engine - Programmatically uncheck layer in AxTOCControl


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#



Answer



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...