Select to view content in your preferred language

Is it possible to hide  a Dataframe from TOC using VB.NET (arcgis 9.2)?

1075
5
10-09-2012 09:32 PM
AnishKumar
Emerging Contributor
If we have multiple data frames in a TOC (display View), is it possible to hide a particular Dataframe legend & associated layers from TOC using VB.NET. I am trying to create one view corresponding to one Data frame. So that the user can select one data frame (with predefined  name) at one time using an external button (unique button for each predefined dataframes).
ps. I don't have an ArcGIS engine & I am using Arcmap 9.2

Regards
Anish
0 Kudos
5 Replies
NeilClemmons
Honored Contributor
You can manage the maps that are in a document via IMxDocument.Maps.
0 Kudos
AlexanderGray
Honored Contributor
I have never done this but my understanding is that the TOC inherits from a C++ treeview.  I know people who, in C++, were able to downcast the TOC to the C++ treeview type and read the properties of the treeview to access properties not exposed in AO.  You could probably change the properties too. Not too sure if this would be of any use though or if it is really supportable.
0 Kudos
AnishKumar
Emerging Contributor
Thanks Neil, If I use IMxDocument.Maps I could see only Count, Create, Item, Reset Remove and RemoveAt members. Could n't find a hide option or setting the "Visibilty" to it. If I cant hide the Dataframe legend from Display view another option I think i could use is create a Custom tab to the TOC with all the functionality of "Display Tab" with only the active Dataframe visible in that new TOC Tab. But I could not implement it because only the default three tabs (Display, Source, & Selection) are allowed ( I Also tried to add an additional content View but couldn't set properties to it as properties are Readonly)
Is it possible to create a new custom Tab which works similar to "Display" Tab in the TOC. I tried an ArcGis Class with Base Implementation of an Application Framework TOC View (ArcMap). But this doesn't add any new tab to the TOC. Can you please suggest any options.

Anish



You can manage the maps that are in a document via IMxDocument.Maps.
0 Kudos
NeilClemmons
Honored Contributor
All you need to do is keep up with your own collection of maps.  When a document is opened, load your collection from the document's maps collection.  You "hide" a map by removing it from the document's maps collection.  You "show" the map by adding the map from your collection back into the document's maps collection.  When a document is closed, load all of the maps from your collection back into the document's collection so that the document remains unchanged.
0 Kudos
AnishKumar
Emerging Contributor
Thank you Neil, Seems a nice solution.
 


All you need to do is keep up with your own collection of maps.  When a document is opened, load your collection from the document's maps collection.  You "hide" a map by removing it from the document's maps collection.  You "show" the map by adding the map from your collection back into the document's maps collection.  When a document is closed, load all of the maps from your collection back into the document's collection so that the document remains unchanged.
0 Kudos