Question
Need help with this windows form assignment. This is the design of the alarm clock. The (sample) text in the time label and in the
Need help with this windows form assignment.
This is the design of the alarm clock. The (sample) text in the time label and in the alarm time textbox are just to see what theyll look like when the clock is running when created it must always show the current time.
Double-click the form to create a Form Load method. Load the current time into the time label hour, minute second, AM/PM.
You might also save the forms background colour into a global System.Drawing.Color variable just sayn.
From the Component category in the toolbox, add a clock timer and an alarm timer. Have each issue a Tick event once a second. The clock timer is always active. When it issues a tick event, update the clock display and, if Alarm Activate is checked, check the alarm time.
when switch to 24 hour clock is checked - display the clock in 24 hour format (0-24 example 1PM=13) - the AM/PM must not be shown.
The alarm timer is initially inactive. When the displayed time equals the alarm time and Alarm Active is checked, activate the alarm timer. Every time it issues a tick event, play a sound you may wish to alternate the clock face from red to green & back on each tick.
When Stop Alarm is clicked or the Alarm Active checkbox is unchecked, de-activate the alarm timer and reset the background colour (if you were changing that too)
To play a sound:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = @"c:\windows\media\Windows Logoff Sound.wav";
player.Play();
Alarm Clock 06:42:28 AM Stop Alarm Switch to 24 hour clock about Activate Alarm Error Messages Alarm Clock 06:42:28 AM Stop Alarm Switch to 24 hour clock about Activate Alarm Error MessagesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started