Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Done a reminder application & i am done with all insert/update/delete events, what i need now is to popup messages on a particular tym specified by user while adding event(saved table). Please help me
Posted
Comments
OriginalGriff 24-Apr-15 2:13am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

Abdul, I think that what you need to do is create a timer that fires every 60 seconds. When it fires, check the user's reminders to see if anything is due and then display a dialog box with the information.
 
Share this answer
 
Comments
Abdul Rahman BCS 27-Apr-15 3:50am    
Any code samples or link?
Here is some simple code to demonstrate a timer.

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TimerExample
{
    public partial class Form1 : Form
    {
        private List<tuple><datetime,>> appointmentList;
        private Timer timer;

        public Form1()
        {
            InitializeComponent();
            lblMessage.Text = "";
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            // Create a list of test calendar items
            CreateCalendarItems();

            // Create the timer and start it
            CreateTimer();

            lblMessage.Text = "Timer Started";
            SetTime();
        }

        private void CreateCalendarItems()
        {
            appointmentList = new List<tuple><datetime,>>();

            // Add 3 example appointments to the list
            appointmentList.Add(new Tuple<datetime,string>(DateTime.Now.AddMinutes(1), "Budget meeting"));
            appointmentList.Add(new Tuple<datetime,string>(DateTime.Now.AddMinutes(2), "Marketing meeting"));
            appointmentList.Add(new Tuple<datetime,string>(DateTime.Now.AddMinutes(3), "Project Review"));
        }

        private void SetTime()
        {
            txtTime.Text = DateTime.Now.ToLocalTime().ToShortTimeString();
        }

        private void CreateTimer()
        {
            timer = new Timer();
            timer.Interval = 10000;     // 10k milliseconds equal 10 seconds
            timer.Tick += timer_Tick;
            timer.Start();
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            SetTime();

            var appointments = appointmentList.Where(a => a.Item1 <= DateTime.Now);
            if (appointments.Count() > 0)
            { 
                string msg = "The following appointments are due:\n\r\n\r";

                // For this simple demo we are displaying all appointments that are due at or before the current time
                foreach (var item in appointments)
                    msg += String.Format("{0} - {1}\n\r\n\r", item.Item2, item.Item1);

                MessageBox.Show(msg);
            }
        }
    }
}</tuple></tuple>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900