472,125 Members | 1,452 Online

# 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
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
>>>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,

:-))
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
Hi Andreas,
\\\\
To give you a third alternative
Dim mywatch As Date = Date.Parse("20:00:00")
Do While mywatch > Date.Now
Application.DoEvents()
Loop
////
Cor
Nov 20 '05 #10

### This discussion thread is closed

Replies have been disabled for this discussion.