Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

alaram clock This is the design of the alarm clock. The (sample) text in the time label and in the alarm time textbox are just

alaram clock
image text in transcribed
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 they'll look like when the clock is running - when created it must always show the current time to the second. Double-click the form to create a Form Load method. Load the current time into the time label ... hour, minute second, AM/PM. Also, consider saving here the form's background colour into a private variable (t.e. of type System.Drawing. Color). Why? So that you can reset it after the timer is stopped (see below). From the Component category in the toolbox, add 2 timers: 1 for a clock timer and another for 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. The alarm timer is initially inactive. The user enters the alarm time in H:MM format with AM/PM, e.g. 3:11 PM. When the displayed time equals (to the second) the alarm time and "/s alarm active?" is checked, activate the alarm timer. That is, play a sound and every time it fires a tick event you may wish to alternate the clock face from red to green \& back on cach tick. When "Use 24 hour clock?" is checked, display the clock in 24 hour format (023, e.g. IPM=13) - the AM/PM must not be shown in this mode. When Stop Alarm is clicked or the Alarm Active checkbox is unchecked, deactivate 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. Sound Location = (a) "siwindows medialAlarm01, wav"; If Or 1 - 10, another wave file player.Play(0; // Or: player.PlayLooping(); Marking: 1 - current time is displayed 8 stays current 2 - alarm sounds if alarm time equals clock time and Alarm Active is checked. 3 - alarm stops sounding when Siop Alarm is clicked Note: the alternating red to green background colour is nice to have and not required to get 3/3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions