Reminder Application


I have created a reminder application where you can set reminders in your computer. Just set the date and time of reminder and at that time, a reminder will be displayed on the right down corner of your computer. Please find the step how to set Reminder Application in your system?

Learn Reminder Application in your computer system


I have created a reminder application where you can set reminders in your computer. Just set the date and time of reminder and at that time, a reminder note will be displayed on the right down corner of your computer screen.

In this application, I have used Grid View to save the reminder time and messages and this grid view will be shown to you after you click on the reminder button.



#region "Using"
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using CustomUIControls;
using System.IO;
using System.Security;
using Microsoft.Win32;
#endregion

#region "namespace AlwaysIAMWITHYOUDEAR"
namespace AlwaysIAMWITHYOUDEAR
{
#region "frmNewAlert"
public partial class frmNewAlert : Form
{
#region "Global Declaration"


public DataTable dt = new DataTable("AlertTable");
public DataSet ds = new DataSet();
public DataColumn dc;// = new DataColumn();
TaskbarNotifier taskbarNotifier1;
static int Flag = 0;

String path = Environment.CurrentDirectory + @"\Muhil.xml";
#endregion
#region "Constructor frmNewAlert()"
public frmNewAlert()
{
InitializeComponent();
taskbarNotifier1 = new TaskbarNotifier();
taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "BackGround1.bmp"), Color.FromArgb(255, 0, 255));
taskbarNotifier1.SetCloseBitmap(new Bitmap(GetType(), "Close1.bmp"), Color.FromArgb(255, 0, 255), new Point(580, 4));
System.IO.FileInfo fi = new System.IO.FileInfo(path);
if (fi.Exists)
{
ds.ReadXml(path);
}
if (ds.Tables.Count <= 0)
{
dc = new DataColumn();
dc.DataType = System.Type.GetType("System.String");
dc.ColumnName = "DateTime";
dc.Caption = "Date and Time ";
dt.Columns.Add(dc);

dc = new DataColumn();
dc.DataType = System.Type.GetType("System.String");
dc.ColumnName = "AlertMessage";
dc.Caption = "Message to be display";
dt.Columns.Add(dc);


ds.Tables.Add(dt);
}
timer1.Enabled = true;
}
#endregion
#region"SetBall"
private void SetBall()
{
notifyIcon1.ShowBalloonTip(2000, "Ankur's Reminder Application", "Set your reminder here", ToolTipIcon.Info);
}
#endregion

#region "frmNewAlert_Load"

private void frmNewAlert_Load(object sender, EventArgs e)
{
checkValid();
SetBall();
fnComboFill(comboBox4, 1, 12);
fnComboFill(comboBox5, 0, 60);
comboBox6.Items.Add("AM");
comboBox6.Items.Add("PM");
fnDatGridBind();
if (dataGridView1.ColumnCount > 0)
{
dataGridView1.Columns[0].ReadOnly = true;
}
}
#endregion

#region "sdfd"
void checkValid()
{
if (ds.Tables[0].Rows.Count > 10)
{
MessageBox.Show("Do you want Original Version?. Contact me through the same website");
Flag = 1;
this.Close();
}
}



#endregion

#region "fnComboFill"

private void fnComboFill(ComboBox cmb, int start, int end)
{
int i;
for (i = start; i <= end; i++)
{
if (i < 10)
{
cmb.Items.Add("0" + i);
}
else
{
cmb.Items.Add(i);
}
}

}
#endregion

#region "fnDatGridBind"

private void fnDatGridBind()
{
dataGridView1.DataSource = ds.Tables[0];
if (dataGridView1.RowCount > 0)
{
dataGridView1.Columns[0].Width = 150;
dataGridView1.Columns[1].Width = 330;

}
}

#endregion

#region "btnSave_Click"

private void btnSave_Click(object sender, EventArgs e)
{
if ((comboBox4.SelectedIndex >= 0) && (comboBox5.SelectedIndex >= 0) && (comboBox6.SelectedIndex >= 0))
{
if (textBox3.Text.Length != 0)
{
String s1 = comboBox4.SelectedItem + ":" + comboBox5.SelectedItem + " " + comboBox6.SelectedItem;
String tmpdate = dateTimePicker1.Value.ToShortDateString() + " " + s1;
DateTime dt1 = DateTime.Parse(tmpdate);//, CultureInfo.InvariantCulture);
if (dt1 <= DateTime.Now)
{
MessageBox.Show("Select Date and Time should be greater than the Current Date Time");
}
else
{
fnCheck(1, dt1);
Clear();
}
}
else
{
MessageBox.Show("Should enter message");
}

}
else
{
MessageBox.Show("Select Proper Timings");


}

}
#endregion

private void Clear()
{
textBox3.Text = "";
// fnComboFill();
}


#region "timer1_Tick"

private void timer1_Tick(object sender, EventArgs e)
{
DateTime dt = DateTime.Now;

fnCheck(0, dt);

}
#endregion

private void fnCheck(int flag, DateTime dt)
{
DataView dv = new DataView();
dv = ds.Tables[0].DefaultView;
dv.Sort = "DateTime Asc";
DataRowView[] rows = dv.FindRows(dt);
if (flag == 1)
{
if (rows.Length > 0)
{
MessageBox.Show("Alert Already created at this time , Set other timings");
}
else
{
DataRow dr = ds.Tables[0].NewRow();
dr["DateTime"] = dt.ToString();
dr["AlertMessage"] = textBox3.Text.Trim();
ds.Tables[0].Rows.Add(dr);
ds.WriteXml(path);
fnDatGridBind();
checkValid();
}
}
else
{
String d;
if (rows.Length > 0)
{
d = rows[0][1].ToString();
taskbarNotifier1.Show1(d, 500, 500);
ds.Tables[0].Rows.RemoveAt(dv.Find(rows[0][0]));
ds.WriteXml(path);
fnDatGridBind();
}
}
}

#region "toolStripMenuItem1_Click"

private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
SetBall();
}
#endregion

#region "toolStripMenuItem2_Click"

private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
this.Close();
}

#endregion

#region "notifyIcon1_MouseDoubleClick"

private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
SetBall();
}
#endregion

#region "frmNewAlert_Resize"

private void frmNewAlert_Resize(object sender, EventArgs e)
{
if (FormWindowState.Minimized == WindowState)
{
Hide();
}
}

#endregion

#region "frmNewAlert_FormClosing"

private void frmNewAlert_FormClosing(object sender, FormClosingEventArgs e)
{
if (Flag == 0)
{
DialogResult dr = MessageBox.Show("If you close the application, reminder will not be displayed. Do you want to close the application?", "Alerts", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.No)
{
e.Cancel = true;
Hide();
SetBall();
}
else
{
MessageBox.Show("Thank You for using this application.");
}
}

}
#endregion


#region "fnDeletePreviousRecord"
private void fnDeletePreviousRecord()
{
ds.ReadXml(path);

}
#endregion

private void button1_Click(object sender, EventArgs e)
{
fnDeletePreviousRecord();
}

private void dataGridView1_KeyUp(object sender, KeyEventArgs e)
{
if ((e.KeyCode == System.Windows.Forms.Keys.Enter) || (e.KeyCode == System.Windows.Forms.Keys.Tab))
{
CurrencyManager gridCurrencyManager = (CurrencyManager)this.BindingContext[dataGridView1.DataSource, dataGridView1.DataMember];
//MessageBox.Show(gridCurrencyManager.Count.ToString());
gridCurrencyManager.EndCurrentEdit();
dataGridView1.DataSource = gridCurrencyManager;
ds.AcceptChanges();
ds.WriteXml(path);
fnDatGridBind();
}
else if (e.KeyCode == System.Windows.Forms.Keys.Delete)
{
ds.AcceptChanges();
ds.WriteXml(path);
fnDatGridBind();
}
}

private void textBox3_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == System.Windows.Forms.Keys.Enter)
{
btnSave_Click(sender, e);
}
}

private void dataGridView1_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{

}

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

}
}

#endregion
}
#endregion


Attachments

  • Reminder Application (43355-11323-REMINDER.sln)
  • Comments

    Author: Ashok Babu Kandula01 Dec 2011 Member Level: Gold   Points : 0

    Hi Ankur,

    Can you please provide me the CustomUIControl as the Solution is not available to download.

    Thanks In Advance.

    You can reach me at: ashokraj16@gmail.com

    Author: Ankur03 Jan 2012 Member Level: Silver   Points : 0

    Hi Ashok,

    I have uploaded the source code as well alongwith this post.

    Regards,

    Ankur



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: