ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / AddOverlayControl Method
A class containing the control to add. MapViewOverlayControl can be used or create another class that implements IMapViewOverlayControl.
Example

In This Topic
    AddOverlayControl Method
    In This Topic
    Add a control over the view.
    Syntax
    public void AddOverlayControl( 
       IMapViewOverlayControl overlayControl
    )
    Public Sub AddOverlayControl( _
       ByVal overlayControl As IMapViewOverlayControl _
    ) 

    Parameters

    overlayControl
    A class containing the control to add. MapViewOverlayControl can be used or create another class that implements IMapViewOverlayControl.
    Remarks
    The control should be held in a member variable if access is required later, or to send to RemoveOverlayControl when no longer needed.
    Example
    MapView Overlay Control
    //Creat a Progress Bar user control
    var progressBarControl = new System.Windows.Controls.ProgressBar();
    //Configure the progress bar
    progressBarControl.Minimum = 0;
    progressBarControl.Maximum = 100;
    progressBarControl.IsIndeterminate = true;
    progressBarControl.Width = 300;
    progressBarControl.Value = 10;
    progressBarControl.Height = 25;
    progressBarControl.Visibility = System.Windows.Visibility.Visible;
    //Create a MapViewOverlayControl. 
    var mapViewOverlayControl = new MapViewOverlayControl(progressBarControl, true, true, true, OverlayControlRelativePosition.BottomCenter, .5, .8);
    //Add to the active map
    MapView.Active.AddOverlayControl(mapViewOverlayControl);
    await QueuedTask.Run(() =>
    {
      //Wait 3 seconds to remove the progress bar from the map.
      Thread.Sleep(3000);
    
    });
    //Remove from active map
    MapView.Active.RemoveOverlayControl(mapViewOverlayControl);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also