Rename the Map/Map Pane Tab

104
2
Jump to solution
03-02-2018 11:00 AM
Highlighted
by
Occasional Contributor II

I want to set the Caption for the map pane to represent what is in that map pane.  I know how to do this programmatically to the caption using the following, but that does not save.

ProApp.Panes.ActivePane.Caption = caption;

I know you can do this manually in catalog using Right/Click rename.  I want to do this in code based on what I created in that map.  This way I don't have to reload the Caption on MapLoad everytime if it is already set.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi M,

 Your code snippet renames the caption of the pane.  If you execute our code snippet you see the pane caption (displayed in the tab) is actually updated.  However, a right click 'rename' in Catalog will update the Map object.  There is a SetName method to update the name of the map:  http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11891.html

      QueuedTask.Run(() => {
        MapView.Active.Map.SetName("Test");
      });

View solution in original post

2 Replies
Highlighted
Esri Contributor

map.SetName("name here")? Map name is the default caption.

http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11891.html

Reply
0 Kudos
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi M,

 Your code snippet renames the caption of the pane.  If you execute our code snippet you see the pane caption (displayed in the tab) is actually updated.  However, a right click 'rename' in Catalog will update the Map object.  There is a SetName method to update the name of the map:  http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic11891.html

      QueuedTask.Run(() => {
        MapView.Active.Map.SetName("Test");
      });

View solution in original post