问题:使用Arcmap为宿主程序进行插件式开发时(选择Extendding ArcObjects模板)调用Arcmap自身进度条。
解决方法:
1 //获得IStepProgressor 进度条,并进行初始设置 2 IStepProgressor stepProgressor = m_application.StatusBar.ProgressBar; 3 stepProgressor.MinRange = 1; 4 stepProgressor.MaxRange = 10000; 5 6 //设置每次迭代时的进度反馈 7 while (feaNum<100000) 8 { 9 feaNum++; 10 stepProgressor.Position = feaNum; 11 stepProgressor.Message = "目前是第"+feaNum+"个要素"; 12 stepProgressor.Step(); 13 stepProgressor.Show(); 14 }
时间: 2024-10-10 06:01:08