every day a clock event

Martijn van Dru

Newcomer
Joined
Jun 10, 2003
Messages
23
Hello

What is the easiest way of letting every day an event happen? Let say I want to display every mornig at 8.00 o'clock a messagebox that says goodmorning.
Thank you if tou have any suggestions.

Martijn
 
Use a Timer and in the timers event check to see if DateTime is equal to the time you want.
 
well my little countdown app ( wonder why i'm using a countdown app :-\ ;) ) goes like this ....
Visual Basic:
    Private twins As String = String.Empty

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
    End Sub

    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        Timer1.Enabled = False
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If DateTime.Now.Hour = "10" And DateTime.Now.Minute = "30" And DateTime.Now.Second = "00" And DateTime.Now.Millisecond < 100 Then
            twins = "days till the birth of our twins: "
            twins += DateDiff(DateInterval.Day, DateTime.Now, DateTime.Parse("28/08/2003 08:00:00")).ToString
            MessageBox.Show(twins, DateTime.Parse("28/08/2003 08:00:00").ToLongDateString, MessageBoxButtons.OK, MessageBoxIcon.Information)
            twins = ""
        End If
    End Sub
not sure if it helps.
 
Back
Top