ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Framework.Threading.Tasks Namespace / ProgressDialog Class / ProgressDialog Constructor / ProgressDialog Constructor(String,String,UInt32,Boolean)
Example

In This Topic
    ProgressDialog Constructor(String,String,UInt32,Boolean)
    In This Topic
    Creates a cancelable progress dialog with the specified number of steps.
    Syntax
    Public Function New( _
       ByVal message As String, _
       ByVal cancelMessage As String, _
       ByVal steps As UInteger, _
       Optional ByVal delayedShow As Boolean _
    )

    Parameters

    message
    cancelMessage
    steps
    delayedShow
    Example
    Running Geoprocessing Tool with ProgressDialog
    var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel", 100, true);
          progDlg.Show();
          
          var progSrc = new CancelableProgressorSource(progDlg);
    
          // prepare input parameter values to CopyFeatures tool
          string input_data = @"C:\data\california.gdb\ca_highways";
          string out_workspace = ArcGIS.Desktop.Core.Project.Current.DefaultGeodatabasePath;
          string out_data = System.IO.Path.Combine(out_workspace, "ca_highways2");
    
          // make a value array of strings to be passed to ExecuteToolAsync
          var parameters = Geoprocessing.MakeValueArray(input_data, out_data);
    
          // execute the tool
          await Geoprocessing.ExecuteToolAsync("management.CopyFeatures", parameters,
              null, new CancelableProgressorSource(progDlg).Progressor, GPExecuteToolFlags.Default);
    
          // dialog hides itself once the execution is complete
          progDlg.Hide();
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also