S
Speed Ack
Guest
I want a way to have my calendar appointments to automatically pop-up on the system when the set date for appointment is reached.
I am able to set appointments on the calendar, and able to have a message "You have an appointment set for today" BUT ONLY displays the message when i manually click on the appointment app meaning someone has to click on the app everyday to see if there are appointments for that day which shouldn't be the case.
How can the set appointment message automatically pop-up on the screen.
Here is what I have done:
Imports System.IO
Public Class Appointment
Dim r As MsgBoxResult
Dim t As String
Private Sub SetApp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim m As MsgBoxResult
t = AppCalendar.SelectionRange.Start.Month.ToString & AppCalendar.SelectionRange.Start.Day.ToString
If Date.Today = AppCalendar.TodayDate And File.Exists(t & ".txt") = True Then
m = MsgBox("You have appointment set for today, would you like to view?", MsgBoxStyle.YesNo)
If m = MsgBoxResult.Yes Then
AppCalendar.Enabled = False
AppCalendar.Hide()
txtMsg.Enabled = True
txtMsg.Show()
txtMsg.Text = ""
btnSet.Enabled = True
btnSet.Show()
btnBack.Enabled = True
btnBack.Show()
txtMsg.Text = File.ReadAllText(t & ".txt")
End If
End If
End Sub
Private Sub AppCalendar_DateSelected(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles AppCalendar.DateSelected
t = AppCalendar.SelectionRange.Start.Month.ToString & AppCalendar.SelectionRange.Start.Day.ToString
Try
If File.Exists(t & ".txt") = True Then
AppCalendar.Enabled = False
AppCalendar.Hide()
txtMsg.Enabled = True
btnSet.Enabled = True
btnSet.Show()
btnBack.Enabled = True
btnBack.Show()
txtMsg.Text = File.ReadAllText(t & ".txt")
Else
r = MsgBox("Enter appointment for this day?", MsgBoxStyle.YesNo)
If r = MsgBoxResult.Yes Then
Calendar.Enabled = False
Calendar.Hide()
txtMsg.Enabled = True
txtMsg.Show()
txtMsg.Text = ""
btnSet.Enabled = True
btnSet.Show()
btnBack.Enabled = True
btnBack.Show()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnSet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSet.Click
Try
If txtMsg.Text = "" Then
If File.Exists(t & ".txt") = True Then
File.Delete(t & ".txt")
End If
End If
If txtMsg.Text.Length > 0 Then
File.WriteAllText(t & ".txt", txtMsg.Text)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
txtMsg.Enabled = False
txtMsg.Hide()
btnSet.Enabled = False
btnSet.Hide()
btnBack.Enabled = False
btnBack.Hide()
AppCalendar.Enabled = True
AppCalendar.Show()
End Sub
NOTE: Everything is working except the appointment messages can't automatically pop-up
Continue reading...
I am able to set appointments on the calendar, and able to have a message "You have an appointment set for today" BUT ONLY displays the message when i manually click on the appointment app meaning someone has to click on the app everyday to see if there are appointments for that day which shouldn't be the case.
How can the set appointment message automatically pop-up on the screen.
Here is what I have done:
Imports System.IO
Public Class Appointment
Dim r As MsgBoxResult
Dim t As String
Private Sub SetApp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim m As MsgBoxResult
t = AppCalendar.SelectionRange.Start.Month.ToString & AppCalendar.SelectionRange.Start.Day.ToString
If Date.Today = AppCalendar.TodayDate And File.Exists(t & ".txt") = True Then
m = MsgBox("You have appointment set for today, would you like to view?", MsgBoxStyle.YesNo)
If m = MsgBoxResult.Yes Then
AppCalendar.Enabled = False
AppCalendar.Hide()
txtMsg.Enabled = True
txtMsg.Show()
txtMsg.Text = ""
btnSet.Enabled = True
btnSet.Show()
btnBack.Enabled = True
btnBack.Show()
txtMsg.Text = File.ReadAllText(t & ".txt")
End If
End If
End Sub
Private Sub AppCalendar_DateSelected(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles AppCalendar.DateSelected
t = AppCalendar.SelectionRange.Start.Month.ToString & AppCalendar.SelectionRange.Start.Day.ToString
Try
If File.Exists(t & ".txt") = True Then
AppCalendar.Enabled = False
AppCalendar.Hide()
txtMsg.Enabled = True
btnSet.Enabled = True
btnSet.Show()
btnBack.Enabled = True
btnBack.Show()
txtMsg.Text = File.ReadAllText(t & ".txt")
Else
r = MsgBox("Enter appointment for this day?", MsgBoxStyle.YesNo)
If r = MsgBoxResult.Yes Then
Calendar.Enabled = False
Calendar.Hide()
txtMsg.Enabled = True
txtMsg.Show()
txtMsg.Text = ""
btnSet.Enabled = True
btnSet.Show()
btnBack.Enabled = True
btnBack.Show()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnSet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSet.Click
Try
If txtMsg.Text = "" Then
If File.Exists(t & ".txt") = True Then
File.Delete(t & ".txt")
End If
End If
If txtMsg.Text.Length > 0 Then
File.WriteAllText(t & ".txt", txtMsg.Text)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
txtMsg.Enabled = False
txtMsg.Hide()
btnSet.Enabled = False
btnSet.Hide()
btnBack.Enabled = False
btnBack.Hide()
AppCalendar.Enabled = True
AppCalendar.Show()
End Sub
NOTE: Everything is working except the appointment messages can't automatically pop-up
Continue reading...