阅读:1425回复:1
Using Progress Dialog Box
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 |
|
|
1楼#
发布于:2004-02-15 15:45
不知道为什么,这个东西好像不能实现cancel功能,原来我用过这个窗体来显示事务进度,后来因为不能取消,还是做了个窗体来显示进度,要命!
|
|
|