Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alarm Clock

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
GB
I need to creat an alarm clock that is set by a series of input boxes. That series is triggered by a command button. I have a clock displayed on a label by use of a timer, but I cannot CALL the set alarm time into the Timer1_timer procedure. I do not know if this is the right way to approach this problem, but if any of you have any ideas? TIA. Let me know if you need more info.
 
I designed my alarmclock by using 1 timer to display the time. I used another timer to check when the set alarm time matches the system time. So the solution is: use 2 timers controls.


 
How did you get the set alarm time into the second timer's procedure code? TIA for your continued help.
 
I have an alarm clock with 2 alarms that can be set at differant times it uses 2 timers and is very simple would be easy to make it play music or anything else.

it has small and full screen settings, will show if both alarms are on or of and the am/pm setting just like the alarm clock next to your bed. I use it on my laptop when I travel.
 
Here's the sub where the set alarm time is checked with the system time. The set alarm time is entered by the user into a textbox, and is then put into the variable dtmTime (same goes for the set alarm date, dtmDate). The set alarm time is then matched with the system time (by using the Time function) and the set alarm date with the system date (by using the Date function). You only need the set alarm date if you want to be able to use the alarm clock over several days. Hope this answers your question.

Private Sub Timer1_Timer()
If dtmTime <= Time And dtmDate = Date Then
Timer1.Enabled = False
ExitWindowsEx EWX_SHUTDOWN, 0 'shutdown pc
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top