title: How to Auto Open or refresh or reload my Form when the date i set in reminders the same with the date in my computer?
body: <p>I made a program Reminder System that Auto send email when the date i set in my apps  much the date in my computer. the problem is i need to restart my apps so that the reminder will show or the form will be loaded. if not it will not alert. so i need your help guys if the date change in my computer my apps will auto reload or refresh so that if have reminders it will be send to email. btw my program will be installed in a server that will always be open so i just need to auto reload my form every time the date change. below is my code in setting the reminders.</p>
  
  <pre><code>  Imports System.IO
    Public Class Reminder
  Dim m As MsgBoxResult
  Dim t As String
  Private Sub Reminder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Label1.Text = TimeOfDay.ToString("h:mm:ss tt")
      Dim m1 As MsgBoxResult
      t = MonthCalendar1.SelectionRange.Start.Month.ToString &amp; MonthCalendar1.SelectionRange.Start.Day.ToString
      If Date.Today = MonthCalendar1.TodayDate And File.Exists(t &amp; ".txt") = True Then
   m1 = MsgBox("You set a reminders for today. Would you like to send to EMAIL ?", MsgBoxStyle.YesNo)
          If m1 = MsgBoxResult.Yes Then
  
              MonthCalendar1.Enabled = False
              MonthCalendar1.Hide()
              Notetxt.Enabled = True
              Notetxt.Show()
              SaveBtn.Enabled = True
              SaveBtn.Show()
              Backbtn.Enabled = True
              Backbtn.Show()
              Addbtn.Enabled = True
              Addbtn.Show()
              delbtn.Enabled = True
              delbtn.Show()
              Notetxt.Text = File.ReadAllText(t &amp; ".txt")
              sendEmail.Show()
              sendEmail.emailtxt.Text = Notetxt.Text
              sendEmail.Hide()
              MsgBox("SEND EMAIL SUCCESSFUL", vbOKOnly)
              lblMessage.Hide()
  
          End If
      End If
  
  
  
  End Sub
  
  Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
      t = MonthCalendar1.SelectionRange.Start.Month.ToString &amp; MonthCalendar1.SelectionRange.Start.Day.ToString
      Try
          If File.Exists(t &amp; ".txt") = True Then
              MonthCalendar1.Enabled = False
              MonthCalendar1.Hide()
              Notetxt.Enabled = True
              Notetxt.Show()
              SaveBtn.Enabled = True
              SaveBtn.Show()
              Backbtn.Enabled = True
              Backbtn.Show()
              Notetxt.Text = File.ReadAllText(t &amp; ".txt")
              Addbtn.Enabled = True
              Addbtn.Show()
              delbtn.Enabled = True
              delbtn.Show()
              lblMessage.Hide()
  
          Else
              m = MsgBox("Would you like to enter a reminders for this date?", MsgBoxStyle.YesNo)
              If m = MsgBoxResult.Yes Then
                  MonthCalendar1.Enabled = False
                  MonthCalendar1.Hide()
                  Notetxt.Enabled = True
                  Notetxt.Show()
                  Notetxt.Text = ""
                  SaveBtn.Enabled = True
                  SaveBtn.Show()
                  Backbtn.Enabled = True
                  Backbtn.Show()
                  Addbtn.Enabled = True
                  Addbtn.Show()
                  delbtn.Enabled = True
                  delbtn.Show()
                  lblMessage.Hide()
  
              End If
          End If
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
  End Sub
  
  Private Sub Backbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Backbtn.Click
      Notetxt.Enabled = False
      Notetxt.Hide()
      MonthCalendar1.Enabled = True
      MonthCalendar1.Show()
      SaveBtn.Hide()
      Addbtn.Hide()
      delbtn.Hide()
      Backbtn.Hide()
      lblMessage.Show()
  
  
  End Sub
  
  Private Sub SaveBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveBtn.Click
  
      t = MonthCalendar1.SelectionRange.Start.Month.ToString &amp; MonthCalendar1.SelectionRange.Start.Day.ToString
  
      Try
          If Notetxt.Text = "" Then
              If File.Exists(t &amp; ".txt") = True Then
                  File.Delete(t &amp; ".txt")
  
              End If
          End If
  
          If Notetxt.Text.Length &gt; 0 Then
              File.WriteAllText(t &amp; ".txt", Notetxt.Text)
              MsgBox("SAVE SUCCESS", vbOKOnly)
  
          End If
      Catch ex As Exception
          MsgBox(ex.Message)
      End Try
  End Sub
  
  Private Sub Addbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Addbtn.Click
      Notetxt.Text = "Hi QC Engineer, Golden Sample meet Due date already please change." &amp; Environment.NewLine &amp; "MODEL: " &amp; Environment.NewLine &amp; "START DATE: " &amp; Environment.NewLine &amp; "DUE DATE: " &amp; Environment.NewLine &amp; "APPROVED BY: EAKKACHAI"
  End Sub
  
  Private Sub delbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles delbtn.Click
      Notetxt.Clear()
      File.Delete(t &amp; ".txt")
  
  
  End Sub
  
  
   End Class
  </code></pre>
  
  <p>and below is my code for sending email.</p>
  
  <pre><code> Public Class sendEmail
  Private Sub sendEmail_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
      Dim Content As String
      Content = emailtxt.Text
      emailtxt.Text = Reminder.Notetxt.Text
      Dim Outlook As New Microsoft.Office.Interop.Outlook.Application
      Dim MailItem As Microsoft.Office.Interop.Outlook.MailItem
      MailItem = Outlook.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
      With MailItem
          .HTMLBody = emailtxt.Text
          .Subject = "GOLDEN SAMPLE DUE DATE EXPIRED"
          'use the below to change from the default email account
          .SentOnBehalfOfName = "your@email.com"
          'you can add multiple recipients using .Add()
          .Recipients.Add("your@email.com")
          'examples of other optional arguments that can be included
          ' .Attachments.Add([file])
          .Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh
          .Send() 'opens the email for checking prior to sending or use .Send()
      End With
  End Sub
  </code></pre>
  
  <p>End Class</p>