Any idea if you can hide any of the sections inside the table of contents using ArcObjects? I'm only interested in the 'List by Visibility section'. I have tried IContentsViewEdit, but doesn't seem to work in 10.X. Even better, I would like to re-create that ContentView in my own dockable window, if that's a possibility.
Another possibility would be to display ILegend in a dockable window. I'm successful in adding it to Layout View, but not a dockable window (see below).
- ILegend legend = new LegendClass_2();
- legend.AutoAdd = true;
- legend.Title = "Test";
- legend.Map = mxdoc.FocusMap;
-
- IMapSurroundFrame MSFrame = new MapSurroundFrameClass();
- MSFrame.MapSurround = legend;
-
- IElement MSElement = MSFrame as IElement;
- IEnvelope en = new EnvelopeClass();
- en.XMin = 1.5; en.YMin = 1.5;
- en.Width = 10; en.Height = 10;
- MSElement.Geometry = en as IGeometry;
-
- IGraphicsContainer gc = mxdoc.PageLayout as IGraphicsContainer;
- gc.AddElement(MSElement, 0);
-
- mxdoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
Any suggestions on wither of these two methods would be great. Thanks