ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Framework Namespace / PaneCollection Class / ClosePane Method
Example

In This Topic
    ClosePane Method
    In This Topic
    Close the pane identified by the specified instance ID.
    Syntax
    Public Sub ClosePane( _
       ByVal id As UInteger _
    ) 
    public void ClosePane( 
       uint id
    )

    Parameters

    id
    Example
    Close a specific pane
    {
      List<uint> myPaneInstanceIDs = [];
      foreach (Pane p in FrameworkApplication.Panes)
      {
        if (p.ContentID == paneID)
        {
          myPaneInstanceIDs.Add(p.InstanceID); //InstanceID of your pane, could be multiple, so build the collection                    
        }
      }
      foreach (var instanceID in myPaneInstanceIDs) //close each of "your" panes.
      {
        FrameworkApplication.Panes.ClosePane(instanceID);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also