ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IMapPane Interface / Caption Property
Example

In This Topic
    Caption Property (IMapPane)
    In This Topic
    Gets or sets the caption for the pane.
    Syntax
    string Caption {get; set;}
    Property Caption As String
    Example
    Find a MapView by its Caption
    {
      string mapPaneCaption = "USNationalParks";
      IMapPane mapViewPane = FrameworkApplication.Panes.OfType<IMapPane>().FirstOrDefault((p) => p.Caption == mapPaneCaption);
      mapView = null;
      if (mapViewPane != null)
      {
        // activate the MapPane
        (mapViewPane as Pane).Activate();
    
        if (mapView != null)
        {
          // get the layers selected in the map's TOC
          var selectedLayers = mapView.GetSelectedLayers();
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also