Rename the Map/Map Pane Tab

643
2
Jump to solution
03-02-2018 11:00 AM
MKa
by
Occasional Contributor III

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.

0 Kudos
1 Solution

Accepted Solutions
Wolf
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
CharlesMacleod
Esri Regular Contributor

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

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

0 Kudos
Wolf
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");
      });