📄 vba11-7.txt
字号:
Public Sub ShowProgressDialog()
Dim pProgressDialogFactory As IProgressDialogFactory
Dim pProgressDialog As IProgressDialog2
Dim pStepProgressor As IStepProgressor
Dim pTrackCancel As ITrackCancel
Dim lngIndex As Long
Dim blnContinue As Boolean
' Use the Progress Dialog Factory to create
' a Progress Dialog.
Set pTrackCancel = New CancelTracker
Set pProgressDialogFactory = New ProgressDialogFactory
Set pProgressDialog = pProgressDialogFactory. _
Create(pTrackCancel, 0)
' Enable the cancel button on the dialog.
pProgressDialog.CancelEnabled = True
pProgressDialog.Title = "Example of Progress Dialog"
' Use a built in animation.
pProgressDialog.Animation = esriProgressGlobe
blnContinue = True
' Set up the progress bar on the dialog.
Set pStepProgressor = pProgressDialog
pStepProgressor.MinRange = 0
pStepProgressor.MaxRange = 10000
pStepProgressor.StepValue = 1
For lngIndex = 0 To 10000
' Carry out the long process here.
' Use the Message property to inform
' user about the macro's activity.
pStepProgressor.Message = lngIndex & _
" of 10000" & " loop"
' Stop processing if Cancel button is selected
blnContinue = pTrackCancel.Continue
pStepProgressor.Step
If Not blnContinue Then Exit For
Next lngIndex
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -