time event at a specific time

  • Thread starter Thread starter Andreas Lundgren
  • Start date Start date
A

Andreas Lundgren

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
 
Andreas Lundgren said:
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.
 
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
 
Hi Fergus,
This you don't end with Regards,
But with
Happy newyear,
Cheers,
Cor
 
Hi Cor,

Happy New Year?

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

Cheers,
Fergus
 
Calculate how long it is before your event and then set the interval on a
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
 
Problem is that the longest intervall is aprox. 64
seconds. So it's not going to be a very long wait...
 
Andreas Lundgren said:
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?
 
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
 
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
 

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

Back
Top