private void kk()
{
IProgressDialogFactory progressDialogFactory = new ProgressDialogFactoryClass();
ITrackCancel trackCancel = new CancelTrackerClass();
IProgressDialog2 progressDialog = (IProgressDialog2)progressDialogFactory.Create(trackCancel, m_hookHelper.ActiveView.ScreenDisplay.hWnd);
progressDialog.CancelEnabled = true;
progressDialog.Description = "My Progress Dialog";
progressDialog.Title = "Get Stepping...";
progressDialog.Animation = esriProgressAnimationTypes.esriProgressGlobe;
IStepProgressor stepProgressor = progressDialog as IStepProgressor;
stepProgressor.MinRange = 0;
stepProgressor.MaxRange = 100000;
stepProgressor.StepValue = 1;
stepProgressor.Message = "Hey!";
progressDialog.ShowDialog();
bool canContinue = true;
for (int i = 0; i < 100000; i++)
{
canContinue = trackCancel.Continue();
if (canContinue)
{
stepProgressor.Step();
}
else
{
progressDialog.HideDialog();
return;
}
}
progressDialog.HideDialog();
}