473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

countdown timer

Hi everyone....

I'm trying to make something work...

When I launch a new form, the application has to quit after a few seconds...

I searched the net for some hours and I can't find any usefull code ...
I noticed there are several timers in .net...
Which one do I use ?

Thanx

John
Nov 21 '05 #1
2 1865
Hi,

If you're using Windows Forms, use a System.Windows.Forms.Timer. Put the
timer on your form and attach to the Timer.Tick event. When the event
fires, call Application.Quit().

You can use System.Threading.Timer if you want, but this uses Windows
resources. The System.Timers.Timer class is more for server-based timers
that need better accuracy and ability to move between threads.

Regards,
-Adam.

John Devlon wrote:
Hi everyone....

I'm trying to make something work...

When I launch a new form, the application has to quit after a few seconds...

I searched the net for some hours and I can't find any usefull code ...
I noticed there are several timers in .net...
Which one do I use ?

Thanx

John

Nov 21 '05 #2
Thx, John.

"John Devlon" <jo********@hotmail.com> wrote in message
news:us*********************@phobos.telenet-ops.be...

Thanx Adam, It works great....

Below the code for other people who need it ...
Private Sub quit_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Timer.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer.Tick
Application.Exit()
End Sub
John


"Adam Goossens" <ad***********@gmail.com> schreef in bericht
news:uN**************@TK2MSFTNGP14.phx.gbl...
Hi,

If you're using Windows Forms, use a System.Windows.Forms.Timer. Put the
timer on your form and attach to the Timer.Tick event. When the event
fires, call Application.Quit().

You can use System.Threading.Timer if you want, but this uses Windows
resources. The System.Timers.Timer class is more for server-based timers
that need better accuracy and ability to move between threads.

Regards,
-Adam.

John Devlon wrote:
Hi everyone....

I'm trying to make something work...

When I launch a new form, the application has to quit after a few
seconds...

I searched the net for some hours and I can't find any usefull code ...
I noticed there are several timers in .net...
Which one do I use ?

Thanx

John


Nov 21 '05 #3

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

Similar topics

3
by: Bonnett | last post by:
I have been creating a generic countdown timer (source code below), counting the seconds, minutes, hours and days till an event, but I have having trouble with it finding out how many hours are...
4
by: Christine | last post by:
I've implemented a countdown timer for a tutorial web page that should give the user 45 minutes to complete the test, only to find that the timer is slowly 'losing' time. On average, it actually...
8
by: Michael | last post by:
I have this script that works the way I want except for one thing... Once it hits zero it starts to count up and looks like this: -1:0-1:0-1:0-18 with the last number counting up. Can anyone...
1
by: Will | last post by:
I have form showing instructions and logging actions and I would like the form to show a count down timer for a certain period of time. E.g. 30 secs, going down to 0 and then displaying the action....
3
by: JimJam | last post by:
Hello Peeps I have created a program in VB.NET 2003 that counts down from 7.5 hours to zero from 08:00. I have a button that starts a new countdown from 1 hour to zero whilst the first one is...
1
by: Dirk Hagemann | last post by:
Hi! I'd like to implement a countdown timer on a webite. It should show the months, days, hours, minutes and seconds until a given date and time. So far it's not really difficult, but this...
9
by: Yet Another One | last post by:
Sorry if this has been answered before, but I simply cannot find the solution on my own. I am looking to do a countdown in my application. Basically, I need to count down from 5:59 (5 minutes,...
9
by: MC | last post by:
I would like to display a timer in the corner of the page that shows the user how many minutes:seconds till the session times out. Are there any good examples out there? Google has again failed...
5
mageswar005
by: mageswar005 | last post by:
hi, I need a javascript countdown timer to my website, I have already the countdown timer but its have some problem. Note: 1) If i choose the tools/internet option in my browser means , at...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.