473,663 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

delay

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.Threa d.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?
Nov 21 '05 #1
2 1433
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.threa d.sleep(i * 1000)
application.doe vents
next
///

I hope this helps,

Cor
Nov 21 '05 #2
"Cor Ligthert" <no************ @planet.nl> schrieb:
(When you use a normal name it is easier to react on previous messages
from you).

\\\
for i as integer = 1 to 11
threading.threa d.sleep(i * 1000)
application.doe vents
next
///


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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
18823
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on Windows 2000 Server If you run the code below, you'll notice something odd occuring. The MilliSecond value does not change after a 1Millisecond delay. Is this a bug or am I doing something wrong? Any assistance will be greatly appreciated
2
16357
by: amos_s12 | last post by:
Hello everybody Is there a possibility to make a delay between two sql statements, namely one sql statement is performed, then there is a delay of some seconds and then rhe next statement is performed. In sybase database, there is a possibility to do such thing by using the statement waitfor delay 'hh:mm:dd' for example: while(...)
6
5552
by: lucifer | last post by:
hi i need to insert delay in my program what function should i use the old delay is not supported by the VC6
20
3011
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a delegate inside the UI that I call to update the progress meter. I use the Suspend() and Abort() methods based on button events. I can watch the progress meter increase just fine when the thread is running. When I select Start, I enable the Cancel...
11
21242
by: Maheshkumar.R | last post by:
Hi groups, How i can introduce some milliseconds delay in application. How i can do achieve this... let me clearly say... (1) I'm displaying slices of medical images. For framerate - for this i'm loading 2+ slices, 4+ slices in loop to have cine impact..-> Ok working (2) But if i want to reduce the speed...how i can introduce delay inbetween
7
2934
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have some insight about. 1) It takes 20 sec or so to open a tcp socket from the client to the server. It just sits in the TcpClient.conect waiting for something. When I run the same control from a windows application it connects right away and works...
4
2520
by: Jeremy S | last post by:
I have written an ASP.NET application that performs very well. I make heavy use of the Cache and otherwise minimize the number of round trips to to the db. I couldn't be happier with the performance - except when the application first starts. When hitting my Web server over the Internet there is a delay waiting for the first page. I suspect that the App Pool is starting up as well as my particular ASP.NET Web application. I should note that...
18
3251
by: Max | last post by:
This is a follow-up on my previous thread concerning having the program wait for a certain date and time and then executing some code when it gets there. My question is; can I use the Sleep function from kernel32 to accomplish this? My concern is that this function takes milliseconds where my program needs to be accurate to within 5 minuets, and delays may be as long as a number of days, months or whatever. Would I run into many problems...
4
782
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I make a 10 second delay? ----------------------------------------------------------------------- There is no built-in way to pause execution in javascript such as a sleep function, but hosts usually provide a method of some form. Web browsers are designed for event driven programming and only provide the « setTimeout » and « setInterval »...
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.