delay

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, i have a program that will execute printing with delay. the last time i
posted a question on how to introduced delay to my program, i believe i given
an advice on using the following...

Threading.Thread.Sleep(11000)

it work fine, but i do want to introduce a "cancel" function in my program
so that my program can stop anytime i want, but with the above command, the
program will hang for 11sec as shown and during this 11sec, no command can be
entered...how can i solve this?
 
Newbie,

(When you use a normal name it is easier to react on previous messages from
you).

\\\
for i as integer = 1 to 11
threading.thread.sleep(i * 1000)
application.doevents
next
///

I hope this helps,

Cor
 
Cor Ligthert said:
(When you use a normal name it is easier to react on previous messages
from you).

\\\
for i as integer = 1 to 11
threading.thread.sleep(i * 1000)
application.doevents
next
///

\\\
Private m_Cancel As Boolean
..
..
..
Private Sub Button1_Click(...)...
m_Cancel = True
End Sub
..
..
..
For i As Integer = 1 To 11
Thread.Sleep(1000)
Application.DoEvents()
If m_Cancel Then Exit For
Next i
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

.png to .gif with convert tool. 13
Delayed Printing - Visio 2007 1
delay in vb.net 1
Loading files into memory 2
PowerPoint Animations 0
time delay 2
Delay when accessing files on a network drive 1
Error Installing "ADAPTEC EZCD 4.04" 1

Back
Top