Public Class ApplicationStartup

    Public Shared Sub Main()
        ' Make sure we get the Windows XP look, if available.
        Application.EnableVisualStyles()

        ' Create this component.
        ' At this point, the NotifyIcon appears automatically
        ' (assuming its Visible property is true).
        Dim App As New ApplicationStartup

        ' Because no forms are being displayed, you need this 
        ' statement to stop the application from automatically ending.
        ' The application will just wait for menu clicks from this point on.
        Application.Run()
    End Sub


    Private Sub cmdExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdExit.Click
        AppIcon.Visible = False
        Application.Exit()
    End Sub

    Private Sub cmdShowClock_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdShowClock.Click
        ' You could show another form here, but we
        ' simply show a message box.
        MessageBox.Show(Date.Now.ToString, "Date", MessageBoxButtons.OK)
    End Sub
End Class
