|
-
Aug 14th, 2000, 09:44 AM
#1
Thread Starter
Addicted Member
Hello!
In my app I'm using a rather slow loop, which takes a lot of time. I'm using a form with a progressbar to show how much time it's left, but I would like to have a commandbutton which the user could press to abort the loop -a cancel button.
I'm not sure how to do this, since pressing a button triggers a new event, and my app is bussy carriyng out the event with the loop.
If you know how to do this, please help me!
Pentax
Wilhelm Tunemyr,
Swede in London
[email protected]
"Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
Heinrich Heine (1797-1856)
Pravda vítezi!
(Truth prevails!)
-
Aug 14th, 2000, 09:47 AM
#2
-
Aug 14th, 2000, 09:50 AM
#3
Junior Member
Yo
Look at this old loop for your anwser
Always let the Wookiee Win!
-
Aug 14th, 2000, 10:07 AM
#4
Hyperactive Member
Just thought I'd give an alternative that's similar in concept: this one shows a loop displaying a countdown and stops when the user hits escape
Code:
Option Explicit
Dim lCntr As Long
Private Sub Command1_Click()
lCntr = 100000
Do While lCntr > 0
lCntr = lCntr - 1
Label1 = lCntr
DoEvents
Loop
End Sub
Private Sub Command2_Click()
lCntr = 0
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|