Jun 12th, 2006, 03:22 PM
#1
Thread Starter
Hyperactive Member
[2005] Reminder
I was going to make a program an i wanted to add, if a user wants to remind them selfs on lets say goto airport to get parents on 7/8/06, When that day came around it will popup a window saying Goto airport to get parents, or what ever the user put. How would i do this???
Im using VB 2005 Express
Jun 12th, 2006, 03:27 PM
#2
Frenzied Member
Re: [2005] Reminder
Well there are multiple aspects to this, so can you be a little more specifc on what you need help with?
But a general how to do this would be this:
You need some way to store the reminders, xml file, text file, database. There are numerous options for that.
Then you'll need a timer to check if it is time to remind. You could create a timer for every reminder. You could have one timer for all reminders.
If you have one timer you are going to need a shorter interval so you don't miss a reminder. If you have a timer for every reminder you can set the timer to the length of time until the reminder (assuming the timer can be set for that length of time).
Jun 12th, 2006, 04:40 PM
#3
Re: [2005] Reminder
You will also need the process to be running constantly in the background.
Jun 12th, 2006, 04:48 PM
#4
Re: [2005] Reminder
Heres the code I wrote for a similar app
VB Code:
Option Strict On
Option Explicit On
Public Class Form1
Dim WeeklyBasis As New Specialized.StringCollection
Dim DailyBasis As New Specialized.StringCollection
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Me.NotifyIcon1.Dispose()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ReadSettings()
Timer1.Start()
With Me.NotifyIcon1
.Icon = Me.Icon
.Visible = True
End With
End Sub
Private Sub ReadSettings()
Dim MyXml As New Xml.XmlDocument
Dim XmlNode As Xml.XmlNode
Dim Weekly As Xml.XmlNode
Dim Daily As Xml.XmlNode
MyXml.Load(Application.StartupPath & "\settings.xml")
For Each Node As Xml.XmlNode In MyXml.ChildNodes
If Node.Name = "xml" Then
XmlNode = Node
Exit For
End If
Next
For Each tnode As Xml.XmlNode In XmlNode.ChildNodes
Select Case tnode.Attributes("name").Value
Case "DailyBasis"
Daily = tnode
Case "WeeklyBasis"
Weekly = tnode
End Select
Next
For Each Node As Xml.XmlNode In Daily.ChildNodes
DailyBasis.Add(Node.Attributes("name").Value & "|" & (Node.Attributes("time").Value) & "|" & Node.Attributes("date").Value)
Next
For Each node As Xml.XmlNode In Weekly.ChildNodes
WeeklyBasis.Add(node.Attributes("name").Value & "|" & (node.Attributes("time").Value) & "|" & node.Attributes("date").Value)
Next
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
For i As Int32 = 0 To WeeklyBasis.Count - 1
Dim Values() As String = WeeklyBasis(i).Split("|"c)
If Values(2) = Date.Now.DayOfWeek.ToString AndAlso Values(1).Substring(0, Values(1).IndexOf(":")).ToString = Math.Abs(Convert.ToInt32(Date.Now.TimeOfDay.Hours) - 12).ToString Then
NotifyIcon1.ShowBalloonTip(100, "Reminder!", Values(0), ToolTipIcon.Info)
End If
Next
For i As Int32 = 0 To DailyBasis.Count - 1
Dim Values() As String = DailyBasis(i).Split("|"c)
If Values(2) = Date.Now.ToShortDateString AndAlso Values(1).Substring(0, Values(1).IndexOf(":")).ToString = Math.Abs(Convert.ToInt32(Date.Now.TimeOfDay.Hours) - 12).ToString Then
NotifyIcon1.ShowBalloonTip(100, "Reminder!", Values(0), ToolTipIcon.Info)
End If
Next
End Sub
End Class
Add a timer, and a notifyicon.
Download the attachment that will store the dates and stuff, works like a charm
Attached Files
Jun 12th, 2006, 07:27 PM
#5
Thread Starter
Hyperactive Member
Re: [2005] Reminder
Ok, is there a way to write to Settings.xml file, with in the program?
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width