i want to add for example meetings in specific date and time as i want , and i want my application to remainder me before that date and time as i do it ,maybe MessageBox appear to tell me that i have meeting for example !! or in any other way to notify me
how can i do that in c# !!
younis abdeljawwadPosted May 30, 2012, 5:22 PM
and the application check if the date and time in the table of the database i equal to now date and time of before day or hour the application remainder me
Murad BASDAGPosted May 30, 2012, 4:28 AM
You can try to use Timer component of .NET framework. In this component you can set interval. That's mean is every time the timer reach to interval time (for example 1000ms) tick event will be automatically fired by the timer component. And you can do anything you want in this event. You can check is the current time reached to the alarm time and if it is you can show a message box or something else.
private void timer1_Tick(.......)
{
timer1.Stop();
if( DateTime.Now >= AlarmTime ) {
MessageBox.Show("Alarm. Alarm.");
AlarmTime.AddDays(1); // set the new alarm time.
}
timer1.Start();
}
I hope this is what you need.
Good luck.
Glenn PattonPosted May 30, 2012, 3:55 AM
Sounds a bit like Home Work but you haven't included too many details so....
Assuming you are using a Microsoft Windows Visual C# to do it, I would use a DateTimePicker from Common Controls as well as a list box to store things and look into to using the DateTime structure ie:
DateTime dt = DateTime.Now;
for setting the alert time combined with a message box ie:
MessageBox.Show(dt.ToString());
That should give you a prod in the right direction with out giving you the solution if it is Home Work.
Glenn