Alarm?????

bcm

Well-known member
Joined
Aug 13, 2007
Messages
56
Programming Experience
Beginner
Hello friends !!!!!
I want to do a project similar to alarm clock.
If I have written some timings in a string or some thing, whne the current time of clock equals to the timings given it should display the next time given in that string to the user in form of alarm or it should display the form with that time on screen even if the user is using other applications...
Hope my concept is clear to you all .Please Help me in this
Thanks in advance.
:confused:
 
You have to use one of the Timer functionalities. Timers usually are set for an interval, for example milliseconds. This is a time span, .Net call it TimeSpan. The difference between two Date values is a TimeSpan. So if you have Date value ahead in time, for example variable 'future', you can calculate the TimeSpan=future-Date.Now. From this TimeSpan you can extract TotalMilliseconds. The System.Timers.Timer class is ideal for use as alarm since it is threading based and more accurate (not affected by UI thread), and because you can set it to only occur once.
 
Back
Top