Private Sub CmdStop_Click()
blnStop = True
End Sub
Private Sub CmdStart_Click()
Dim I As Long
Dim J As Integer
Label1.Caption = "计算开始......"
Me.MousePointer = 11
blnStop = False
I = 100000
J = 2
Do While (I < 900000)
I = I + 1
If I = 10000 * J Then
Label1.Caption = "已经计算到" & I
J = J + 1
End If
'code............
DoEvents
If blnStop = True Then
Label1.Caption = "计算被停止!"
FileTxt.Close
Me.MousePointer = 0
Exit Sub
End If
Loop
Me.MousePointer = 0
End Sub