gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
阅读:1425回复:1

Using Progress Dialog Box

楼主#
更多 发布于:2003-11-17 10:57
Description:

This sample shows how to use built-in progress dialog box for lengthy operations.

How to use:
1。Start a Visual Basic application.
2。Add a button on the main form. Copy and paste the code.

Private Sub Command1_Click()
  Dim pP As IProgressor
  Dim pPDF As IProgressDialogFactory
  Set pPDF = New ProgressDialogFactory
  Dim pTC As ITrackCancel
  Set pTC = New CancelTracker
  
  Set pP = pPDF.Create(pTC, Command1.hWnd)
  pP.Message = "Clipping"
  Dim pSP As IStepProgressor
  Set pSP = pP
  Dim maxRange As Long
  maxRange = 20000
  pSP.maxRange = maxRange
  pSP.MinRange = 0
  pSP.Show
  Dim i As Integer
  pSP.Position = 0
  pSP.StepValue = 1
  For i = 0 To maxRange
    pSP.Step
     'Do something
     If pTC.Continue = False Then
      pTC.Cancel
      Exit For
    End If
  Next i
  pSP.Position = 0
End Sub

喜欢0 评分0
GIS麦田守望者,期待与您交流。
cafecat
路人甲
路人甲
  • 注册日期2003-07-29
  • 发帖数375
  • QQ
  • 铜币894枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2004-02-15 15:45
不知道为什么,这个东西好像不能实现cancel功能,原来我用过这个窗体来显示事务进度,后来因为不能取消,还是做了个窗体来显示进度,要命!
http://3s2go.blogspot.com/
举报 回复(0) 喜欢(0)     评分
游客

返回顶部