Imports System.Media
Public Class Form1
#Region "Help"
    Dim Prodigy As New SoundPlayer(My.Resources.prodigy)
    Dim boo As New SoundPlayer(My.Resources.Boo)
    Dim bliss As New SoundPlayer(My.Resources.Bliss)
    Dim another As New SoundPlayer(My.Resources.another)
    Dim Phone As New SoundPlayer(My.Resources.phone)
    Private Sub ViaEmailToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ViaEmailToolStripMenuItem.Click
        Process.Start("mailto:mangciphuz@gmail.com")
    End Sub

    Private Sub AlarmInfoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AlarmInfoToolStripMenuItem.Click
        MsgBox("This Alarm System allows you to set a sleeping time and alarm. Set your alarm time in 24 hour format '23:59:59'" & vbNewLine & _
        "Created by Mangciphu Zola." & vbNewLine & "2009 Program    Ultimate Iron.Inc.", MsgBoxStyle.OkOnly, "Info")
    End Sub


    Private Sub HowToToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HowToToolStripMenuItem.Click
        MsgBox("        HOW TO SET ALARM:" & vbNewLine & "1. Set Hours,min and seconds." & vbNewLine & "2.Select Sound." & vbNewLine & _
        "3. And Check Start." & vbNewLine & "         HOW TO SET SLEEP:" & vbNewLine & "1. Set No Of Hours,Min and Seconds." & vbNewLine & _
        "2. Select An Action[Shutdown or Restart or Log Off or Lock]." & vbNewLine & "3. Check On." & vbNewLine & "If you want to turn OFF Sleep, just click OFF." & vbNewLine & _
        "Design and Coded By: Mangciphu Zola." & vbNewLine & "Year:2009 January." & vbNewLine & "          FEEDBACK:" & vbNewLine & "For feedback or If you experience a problem.PLEASE send me an e-mail:MANGCIPHUZ@MAIL.COM.", MsgBoxStyle.OkOnly, "How To ...")
    End Sub

    Private Sub ViaEmailToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ViaEmailToolStripMenuItem1.Click
        ViaEmailToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub AlarmInfoToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AlarmInfoToolStripMenuItem1.Click
        AlarmInfoToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub HowToToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HowToToolStripMenuItem1.Click
        HowToToolStripMenuItem_Click(sender, e)
    End Sub
#End Region

#Region "Schedule"
    Private Sub AddScheduleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddScheduleToolStripMenuItem.Click
        Process.Start("C:\WINDOWS\Tasks")
    End Sub
    Private Sub ScheduleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ScheduleToolStripMenuItem.Click
        AddScheduleToolStripMenuItem_Click(sender, e)
    End Sub
#End Region

#Region "BackColors"
    Private Sub PinkToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PinkToolStripMenuItem.Click
        Me.BackColor = Color.Pink
    End Sub


    Private Sub DefaultToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DefaultToolStripMenuItem.Click
        Me.BackColor = Color.Blue
    End Sub

    Private Sub GreenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GreenToolStripMenuItem.Click
        Me.BackColor = Color.Green
    End Sub

    Private Sub MaroonToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MaroonToolStripMenuItem.Click
        Me.BackColor = Color.Maroon
    End Sub

    Private Sub YellowToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles YellowToolStripMenuItem.Click
        Me.BackColor = Color.Yellow
    End Sub

    Private Sub TomatoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TomatoToolStripMenuItem.Click
        Me.BackColor = Color.Tomato
        LBLH.ForeColor = Color.Black
        LBLM.ForeColor = Color.Black
        lblS.ForeColor = Color.Black
    End Sub

    Private Sub TransparentToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TransparentToolStripMenuItem.Click
        Me.BackColor = Color.Gray
        LBLH.ForeColor = Color.White
        LBLM.ForeColor = Color.White
        lblS.ForeColor = Color.White
    End Sub

    Private Sub BlueViolentToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BlueViolentToolStripMenuItem.Click
        Me.BackColor = Color.BlueViolet
    End Sub
    Private Sub PinkToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PinkToolStripMenuItem1.Click
        PinkToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub DefaultToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DefaultToolStripMenuItem1.Click
        DefaultToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub GreenToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GreenToolStripMenuItem1.Click
        GreenToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub MaroonToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MaroonToolStripMenuItem1.Click
        MaroonToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub YellowToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles YellowToolStripMenuItem1.Click
        YellowToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub TomatoToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TomatoToolStripMenuItem1.Click
        TomatoToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub GrayToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GrayToolStripMenuItem.Click
        TransparentToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub BlueViolentToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BlueViolentToolStripMenuItem1.Click
        BlueViolentToolStripMenuItem_Click(sender, e)
    End Sub
#End Region

#Region "Time And Stopwatch"
    Dim s, m, h As Int32
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        lblTime.Text = DateAndTime.TimeOfDay & vbNewLine & DateAndTime.DateString & vbNewLine & Now.DayOfWeek.ToString

    End Sub
    Private Sub SetTimeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetTimeToolStripMenuItem.Click
        Shell("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl")
    End Sub
    Private Sub SetTimeDateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetTimeDateToolStripMenuItem.Click
        SetTimeToolStripMenuItem_Click(sender, e)
    End Sub
    Private Sub SetTimeToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetTimeToolStripMenuItem1.Click
        SetTimeToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        If s = 59 Then
            m = m + 1
            s = 0
        End If
        If m = 59 Then
            h = h + 1
            m = 0
        End If
        If h = 23 Then
            s = s + 1
            h = 0
        End If
        s = s + 1
        lblS.Text = s & "s(s) "
        LBLM.Text = m & " m(s) "
        LBLH.Text = h & " h(s)"
    End Sub

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        Timer2.Start()
        btnPause.Enabled = True
        cb2.Checked = True
        btnStart.Enabled = False
        btnStop.Enabled = True
    End Sub
    Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click

        s = 0
        lblS.Text = 0 & "s(s) "
        cb2.Checked = False
        btnPlay.Enabled = True
        Timer2.Stop()
    End Sub

    Private Sub btnPause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPause.Click
        Timer2.Stop()
        btnPause.Enabled = False
        cb2.Checked = False
        btnStart.Enabled = True
    End Sub

    Private Sub StartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartToolStripMenuItem.Click
        btnStart_Click(sender, e)
    End Sub

    Private Sub StopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StopToolStripMenuItem.Click
        btnStop_Click(sender, e)
    End Sub

    Private Sub PauseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PauseToolStripMenuItem.Click
        btnPause_Click(sender, e)
    End Sub

    Private Sub StartToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartToolStripMenuItem1.Click
        StartToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub StopToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StopToolStripMenuItem1.Click
        StopToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub PauseToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PauseToolStripMenuItem1.Click
        PauseToolStripMenuItem_Click(sender, e)
    End Sub


#End Region

#Region "Close form"
    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
        End
    End Sub
    Private Sub ExitToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem3.Click
        End
    End Sub
#End Region

#Region "Sleep On and Off"
    Private Sub CON_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CON.CheckedChanged
        COF.Checked = False
        H1.ReadOnly = True : M1.ReadOnly = True : S1.ReadOnly = True
        Timer3.Enabled = True
    End Sub

    Private Sub COF_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles COF.CheckedChanged
        CON.Checked = False : C1.Checked = False : C2.Checked = False : C3.Checked = False : c4.Checked = False
        H1.Value = 0 : M1.Value = 0 : S1.Value = 0
        H1.ReadOnly = False : M1.ReadOnly = False : S1.ReadOnly = False
        Timer3.Enabled = False
    End Sub
#End Region
#Region "Sleep[Shutdown, Restart,LogOff and Lock]"
    Private Sub C1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles C1.CheckedChanged
        C2.Checked = False
        C3.Checked = False
        c4.Checked = False
    End Sub

    Private Sub c4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c4.CheckedChanged
        C1.Checked = False
        C2.Checked = False
        C3.Checked = False
    End Sub

    Private Sub C2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles C2.CheckedChanged
        C1.Checked = False
        C3.Checked = False
        c4.Checked = False
    End Sub

    Private Sub C3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles C3.CheckedChanged
        C1.Checked = False
        C2.Checked = False
        c4.Checked = False
    End Sub
#End Region
#Region "Alarm Start and Switch Off"

    Private Sub CS_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CS.CheckedChanged
        ct.Checked = False
        If CS.Checked = True Then
            btnPlay.Enabled = False
            Timer5.Enabled = True
            Hour.ReadOnly = True : Minute.ReadOnly = True : Second.ReadOnly = True
            CB.Enabled = False
            CB.SelectedIndex = 0
            CB.Text = CB.SelectedItem.ToString
        Else
            btnPlay.Enabled = True
            Timer5.Enabled = False
            Hour.ReadOnly = False : Minute.ReadOnly = False : Second.ReadOnly = False
            CB.Enabled = True
        End If


    End Sub
    Private Sub SwitchOffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SwitchOffToolStripMenuItem.Click
        ct_CheckedChanged(sender, e)
    End Sub
    Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
        On Error Resume Next
        If Hour.Value = Now.Hour And Minute.Value = Now.Minute And Second.Value = Now.Second Then
            If CB.Text = "Bliss" Then
                bliss.PlayLooping()
            ElseIf CB.Text = "Phone" Then
                Phone.PlayLooping()
            ElseIf CB.Text = "Prodigy" Then
                Prodigy.PlayLooping()
            ElseIf CB.Text = "Boo" Then
                boo.PlayLooping()
            ElseIf CB.Text = "Another" Then
                another.PlayLooping()
            Else
                MsgBox("Please select a song", MsgBoxStyle.OkOnly, "Error")
            End If
        End If

    End Sub

    Private Sub ct_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ct.CheckedChanged
        CS.Checked = False
        btnPlay.Enabled = True
        Hour.ReadOnly = False : Minute.ReadOnly = False : Second.ReadOnly = False
        Bliss.Stop() : Prodigy.Stop() : Boo.Stop() : another.Stop() : Phone.Stop()
        Hour.Value = 0 : Minute.Value = 0 : Second.Value = 0
    End Sub

    Private Sub HelpToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem2.Click
        MsgBox("Set the alarm in 24 hours format.e.g" & "'23:59:59'", MsgBoxStyle.OkOnly, "Alarm Info")
    End Sub

#End Region
#Region "Game"
    Private Sub SpiderToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpiderToolStripMenuItem.Click
        Try

            Process.Start("spider.exe")
        Catch
            MsgBox("The game had been deleted or moved or renamed.", MsgBoxStyle.OkOnly, "Error")
        End Try
    End Sub
    Private Sub SpiderToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpiderToolStripMenuItem1.Click
        SpiderToolStripMenuItem_Click(sender, e)
    End Sub
#End Region

#Region "Shutdown, Lock, Log Off and Restart"
    Private Sub ShutdownToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem6.Click
        Shell("tsshutdn 0 /powerdown /delay:0", AppWinStyle.Hide)
    End Sub

    Private Sub LogOffToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem1.Click
        Shell("shutdown -l", AppWinStyle.Hide)
    End Sub

    Private Sub LockToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem2.Click
        Shell("tsdiscon", AppWinStyle.Hide)
    End Sub

    Private Sub RestartToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem6.Click
        Shell("tsshutdn 0 /reboot /delay:0", AppWinStyle.Hide)
    End Sub

    Private Sub LockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem.Click
        LockToolStripMenuItem2_Click(sender, e)
    End Sub


    Private Sub LoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoToolStripMenuItem.Click
        LogOffToolStripMenuItem1_Click(sender, e)
    End Sub

    Private Sub RestartToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem4.Click
        RestartToolStripMenuItem6_Click(sender, e)
    End Sub

    Private Sub ShutdownToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem4.Click
        ShutdownToolStripMenuItem6_Click(sender, e)
    End Sub
#End Region
#Region "Form Load"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        btnPause.Enabled = False
        btnStop.Enabled = False
        H1.Value = 23
        M1.Value = 59
        S1.Value = 59
    End Sub
#End Region
#Region "SHUTDOWN "
    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        Try
            If CON.Checked = True Then

                If H1.Value = 0 And M1.Value = 0 And S1.Value = 0 Then
                    If C1.Checked = True Then
                        Shell("tsshutdn 0 /powerdown /delay:0", AppWinStyle.Hide)
                    ElseIf C2.Checked = True Then
                        Shell("tsshutdn 0 /reboot /delay:0", AppWinStyle.Hide)
                    ElseIf C3.Checked = True Then
                        Shell("tsdiscon", AppWinStyle.Hide)
                        Timer3.Enabled = False
                    ElseIf c4.Checked = True Then
                        Shell("shutdown -l", AppWinStyle.Hide)

                    Else
                        If C1.Checked = False Or C2.Checked = False Or C3.Checked = False Or c4.Checked = False Then
                            S1.Value = 0 : M1.Value = 0 : H1.Value = 0
                        End If

                    End If
                End If

                If S1.Value = 0 Then
                    If M1.Value = 0 Then
                        H1.Value = H1.Value - 1
                        M1.Value = 59
                    Else
                        M1.Value = M1.Value - 1

                    End If
                    S1.Value = 59
                Else
                    S1.Value = S1.Value - 1
                End If

            End If
        Catch
        End Try
    End Sub

#End Region
#Region "For Songs"
    Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick

        If CB.Text = "Phone" Then
            Phone.PlayLooping()
        ElseIf CB.Text = "Boo" Then
            Boo.PlayLooping()
        ElseIf CB.Text = "Prodigy" Then
            Prodigy.PlayLooping()
        ElseIf CB.Text = "Another" Then
            another.PlayLooping()
        ElseIf CB.Text = "Bliss" Then
            Bliss.PlayLooping()
        Else
            MsgBox("Please select song.", MsgBoxStyle.OkOnly, "Fatal Warning")
        End If

    End Sub
#End Region
#Region "Sleep in 30 minutes"
    Private Sub RestartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem.Click
        M1.Value = 30
        H1.Value = 0
        S1.Value = 59
        C2.Checked = True
        CON.Checked = True
    End Sub

    Private Sub ShutdownToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem.Click
        M1.Value = 30
        H1.Value = 0
        S1.Value = 59
        C1.Checked = True
        CON.Checked = True
    End Sub


    Private Sub LockToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem3.Click
        M1.Value = 30
        H1.Value = 0
        S1.Value = 59
        C3.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LogOffToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem2.Click
        M1.Value = 30
        H1.Value = 0
        S1.Value = 59
        c4.Checked = True
        CON.Checked = True
    End Sub
    Private Sub RestartToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem7.Click
        RestartToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub ShutdownToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem7.Click
        ShutdownToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub LockToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem6.Click
        LockToolStripMenuItem3_Click(sender, e)
    End Sub

    Private Sub LogOffToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem6.Click
        LogOffToolStripMenuItem2_Click(sender, e)
    End Sub
#End Region

#Region "Sleep in 60 minutes"
    Private Sub RestartToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem1.Click
        M1.Value = 59
        H1.Value = 0
        S1.Value = 59
        C2.Checked = True
        CON.Checked = True
    End Sub


    Private Sub ShutdownToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem1.Click
        M1.Value = 59
        H1.Value = 0
        S1.Value = 59
        C1.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LockToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem4.Click
        M1.Value = 59
        H1.Value = 0
        S1.Value = 59
        C3.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LogOffToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem3.Click
        M1.Value = 59
        H1.Value = 0
        S1.Value = 59
        c4.Checked = True
        CON.Checked = True
    End Sub

    Private Sub RestartToolStripMenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem8.Click
        RestartToolStripMenuItem1_Click(sender, e)
    End Sub

    Private Sub ShutdownToolStripMenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem8.Click
        ShutdownToolStripMenuItem1_Click(sender, e)
    End Sub

    Private Sub LockToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem7.Click
        LockToolStripMenuItem4_Click(sender, e)
    End Sub

    Private Sub LogOffToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem7.Click
        LogOffToolStripMenuItem3_Click(sender, e)
    End Sub
#End Region

#Region "Sleep in 90 minutes"
    Private Sub RestartToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem3.Click
        M1.Value = 30
        H1.Value = 1
        S1.Value = 59
        C2.Checked = True
        CON.Checked = True
    End Sub

    Private Sub ShutdownToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem3.Click
        M1.Value = 30
        H1.Value = 1
        S1.Value = 59
        C1.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LToolStripMenuItem.Click
        M1.Value = 30
        H1.Value = 1
        S1.Value = 59
        C3.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LogOffToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem4.Click
        M1.Value = 30
        H1.Value = 1
        S1.Value = 59
        c4.Checked = True
        CON.Checked = True
    End Sub
    Private Sub RestartToolStripMenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem9.Click
        RestartToolStripMenuItem3_Click(sender, e)
    End Sub

    Private Sub ShutdownToolStripMenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem9.Click
        ShutdownToolStripMenuItem3_Click(sender, e)
    End Sub

    Private Sub LockToolStripMenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem8.Click
        LToolStripMenuItem_Click(sender, e)
    End Sub

    Private Sub LogOffToolStripMenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem8.Click
        LogOffToolStripMenuItem4_Click(sender, e)
    End Sub
#End Region

#Region "Sleep in 120 minutes"

    Private Sub RestartToolStripMenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem10.Click
        RestartToolStripMenuItem2_Click(sender, e)
    End Sub

    Private Sub LockToolStripMenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem9.Click
        LockToolStripMenuItem5_Click(sender, e)
    End Sub

    Private Sub LogOffToolStripMenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem9.Click
        LogOffToolStripMenuItem5_Click(sender, e)
    End Sub

    Private Sub ShutdownToolStripMenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem10.Click
        ShutdownToolStripMenuItem2_Click(sender, e)
    End Sub
    Private Sub RestartToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartToolStripMenuItem2.Click
        M1.Value = 0
        H1.Value = 2
        S1.Value = 59
        C2.Checked = True
        CON.Checked = True
    End Sub

    Private Sub ShutdownToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShutdownToolStripMenuItem2.Click
        M1.Value = 0
        H1.Value = 2
        S1.Value = 59
        C1.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LockToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LockToolStripMenuItem5.Click
        M1.Value = 0
        H1.Value = 2
        S1.Value = 59
        C3.Checked = True
        CON.Checked = True
    End Sub

    Private Sub LogOffToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOffToolStripMenuItem5.Click
        M1.Value = 0
        H1.Value = 2
        S1.Value = 59
        c4.Checked = True
        CON.Checked = True
    End Sub
#End Region
#Region "On and Off Sleep"
    Private Sub OnSleepToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OnSleepToolStripMenuItem.Click
        CON_CheckedChanged(sender, e)
    End Sub

    Private Sub OffSleepToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OffSleepToolStripMenuItem.Click
        COF_CheckedChanged(sender, e)
    End Sub
#End Region

#Region "Play Alarm Songs(The Button)"
    Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click
        Try
            If CB.Text = "Boo" Then
                boo.Play()
            ElseIf CB.Text = "Phone" Then
                Phone.Play()
            ElseIf CB.Text = "Prodigy" Then
                Prodigy.Play()
            ElseIf CB.Text = "Another" Then
                another.Play()
            ElseIf CB.Text = "Bliss" Then
                bliss.Play()
            Else
                MsgBox("Please select A Song", MsgBoxStyle.Critical, "Error")
            End If
        Catch
        End Try
    End Sub

#End Region
#Region "Play alarm sounds"
    Private Sub PhoneToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneToolStripMenuItem.Click
        Phone.Play()
    End Sub

    Private Sub BooToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BooToolStripMenuItem.Click
        Boo.Play()
    End Sub

    Private Sub ProdigyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProdigyToolStripMenuItem.Click
        Prodigy.Play()
    End Sub

    Private Sub AnotherToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnotherToolStripMenuItem.Click
        another.Play()
    End Sub

    Private Sub BlissToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BlissToolStripMenuItem.Click
        Bliss.Play()
    End Sub
#End Region

#Region "Alarm Quick Settings"
    Private Sub MinToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinToolStripMenuItem.Click
        If MinToolStripMenuItem.Checked = True Then
            Hour.Value = 16
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If

    End Sub


    Private Sub MinToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinToolStripMenuItem1.Click
        If MinToolStripMenuItem1.Checked = True Then
            Hour.Value = 5
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub MinToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinToolStripMenuItem2.Click
        If MinToolStripMenuItem2.Checked = True Then
            Hour.Value = 19
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem1.Click
        If AmToolStripMenuItem1.Checked = True Then
            Hour.Value = 6
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem.Click
        If AmToolStripMenuItem.Checked = True Then
            Hour.Value = 0
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem2.Click
        If AmToolStripMenuItem2.Checked = True Then
            Hour.Value = 1
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub


    Private Sub AmToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem3.Click
        If AmToolStripMenuItem3.Checked = True Then
            Hour.Value = 2
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem4.Click
        If AmToolStripMenuItem4.Checked = True Then
            Hour.Value = 3
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem5.Click
        If AmToolStripMenuItem5.Checked = True Then
            Hour.Value = 4
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem6.Click
        If AmToolStripMenuItem6.Checked = True Then
            Hour.Value = 7
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem7.Click
        If AmToolStripMenuItem7.Checked = True Then
            Hour.Value = 8
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem8.Click
        If AmToolStripMenuItem8.Checked = True Then
            Hour.Value = 9
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
        If ToolStripMenuItem3.Checked = True Then
            Hour.Value = 10
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem9.Click
        If AmToolStripMenuItem9.Checked = True Then
            Hour.Value = 11
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PMToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PMToolStripMenuItem.Click
        If PMToolStripMenuItem.Checked = True Then
            Hour.Value = 12
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PMToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PMToolStripMenuItem1.Click
        If PMToolStripMenuItem1.Checked = True Then
            Hour.Value = 13
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem2.Click
        If PmToolStripMenuItem2.Checked = True Then
            Hour.Value = 14
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem3.Click
        If PmToolStripMenuItem3.Checked = True Then
            Hour.Value = 15
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem4.Click
        If PmToolStripMenuItem4.Checked = True Then
            Hour.Value = 17
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem5.Click
        If PmToolStripMenuItem5.Checked = True Then
            Hour.Value = 18
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem6.Click
        If PmToolStripMenuItem6.Checked = True Then
            Hour.Value = 20
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem8.Click
        If PmToolStripMenuItem8.Checked = True Then
            Hour.Value = 22
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem7.Click
        If PmToolStripMenuItem7.Checked = True Then
            Hour.Value = 21
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem9.Click
        If PmToolStripMenuItem9.Checked = True Then
            Hour.Value = 23
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub


    Private Sub AmToolStripMenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem10.Click
        If AmToolStripMenuItem10.Checked = True Then
            Hour.Value = 1
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem11.Click
        If AmToolStripMenuItem11.Checked = True Then
            Hour.Value = 2
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem12.Click
        If AmToolStripMenuItem12.Checked = True Then
            Hour.Value = 3
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem13.Click
        If AmToolStripMenuItem13.Checked = True Then
            Hour.Value = 4
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub AmToolStripMenuItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AmToolStripMenuItem14.Click
        If AmToolStripMenuItem14.Checked = True Then
            Hour.Value = 5
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem10.Click
        If PmToolStripMenuItem10.Checked = True Then
            Hour.Value = 13
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem11.Click
        If PmToolStripMenuItem11.Checked = True Then
            Hour.Value = 14
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem12.Click
        If PmToolStripMenuItem12.Checked = True Then
            Hour.Value = 17
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem13.Click
        If PmToolStripMenuItem13.Checked = True Then
            Hour.Value = 18
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem14.Click
        If PmToolStripMenuItem14.Checked = True Then
            Hour.Value = 19
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub

    Private Sub PmToolStripMenuItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PmToolStripMenuItem15.Click
        If PmToolStripMenuItem15.Checked = True Then
            Hour.Value = 20
            Minute.Value = 0
            Second.Value = 0
            CS.Checked = True
        Else
            ct_CheckedChanged(sender, e)
        End If
    End Sub
#End Region

    Private Sub cb2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cb2.CheckedChanged
        If cb2.Checked = True Then
            Phone.PlayLooping()
            btnPlay.Enabled = False
        Else
            Phone.Stop()
            btnPlay.Enabled = True
        End If
    End Sub
End Class
