472,125 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

time event at a specific time

Hi!

Is it possible to get a time event at a specific time, for
instance eight a'clock? My program is running in the
background and is minimized to the tray bar.

If not, is there a smooth way to accomplish this in a
different way?

Best regards,
Andreas Lundgren
Nov 20 '05 #1
9 2463
"Andreas Lundgren" <d9****@efd.lth.se> schrieb
Is it possible to get a time event at a specific time, for
instance eight a'clock? My program is running in the
background and is minimized to the tray bar.

If not, is there a smooth way to accomplish this in a
different way?


Add a Timer and check the date/time each time the Tick or Elapsed event
occurs.
--
Armin

Nov 20 '05 #2
Hi Andreas,

Calculate how long it is before your event and then set the interval on a
new Timer. Start the Timer then sit back and wait.

Regards,
Fergus
Nov 20 '05 #3
Cor
Hi Fergus,
This you don't end with Regards,
But with
Happy newyear,
Cheers,
Cor
Nov 20 '05 #4
Hi Cor,

Happy New Year?

I'm not sure why, but hey - Happy New Year, anyway!! ;-)

Cheers,
Fergus
Nov 20 '05 #5
Cor
>>>Calculate how long it is before your event and then set the interval on a
new Timer. Start the Timer then sit back and wait.


Happy New Year?

I'm not sure why, but hey - Happy New Year, anyway!! ;-)

Cheers,
Fergus


I saw him sitting after his computer with a beer in his hand or something,

I thought you did that too with your answer.
:-))
Cor
Nov 20 '05 #6
Problem is that the longest intervall is aprox. 64
seconds. So it's not going to be a very long wait...

-----Original Message-----
Hi Andreas,

Calculate how long it is before your event and then set the interval on anew Timer. Start the Timer then sit back and wait.

Regards,
Fergus
.

Nov 20 '05 #7
"Andreas Lundgren" <d9****@efd.lth.se> schrieb
Problem is that the longest intervall is aprox. 64
seconds. So it's not going to be a very long wait...


Did you see my suggestion?
--
Armin

Nov 20 '05 #8
Hi Andreas,

64 seconds is ages to a Timer. ;-)

Is there any reason why a Timer wouldn't work, for instance, do you need
more precision than it can provide?

Regards,
Fergus
Nov 20 '05 #9
Cor
Hi Andreas,
\\\\
To give you a third alternative
Dim mywatch As Date = Date.Parse("20:00:00")
Do While mywatch > Date.Now
Application.DoEvents()
Threading.Thread.Sleep(100)
Loop
////
Cor
Nov 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Treetop | last post: by
77 posts views Thread by Charles Law | last post: by
43 posts views Thread by Mike MacSween | last post: by
3 posts views Thread by Brad | last post: by
22 posts views Thread by Drum2001 | last post: by
3 posts views Thread by Aussie Rules | last post: by
reply views Thread by leo001 | last post: by

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.