Hi, i am making an application (Winform) using VS2010 ultimate, (VISUAL BASIC), My apologies for this is a bit long.
i tried searching all over but to no avail...
the application basically:
stores staff index information in a DB(ms Access), (fire safety training date every 6 months, patient care awareness date every year, bio-hazard safety training date every 10 months, other dates that vary in the time they must take place....) all working fine, so far.
Objective: (works fine)
I need the application to be running in the background, i mean the task bar when minimized, i used a notifyIcon, works great, another thing, which is the point of this whole app, is that while minimized and running i placed a timer that is even displayed and counting date and time(dd-mm-yy HH:mm:ss) and so, what i want is that when the next date comes for lets say, fire_safety which is 6 months from the previous one a message box should appear even while minimized to tray to alert the user (many staff and cannot keep track just by opening every day to check!) then user presses OK then they can set a new date or leave it, does not matter so long as they are notified, anyway,
what i did (works fine):
first off, i used my own form as a message box with ok button only.
i used DateDiff, so as to check if the difference between the original or past fire safety date and the "supposedly" next one is more than 6 months then display a MsgBox "staff needs to set a date or BLAH bla..."...
well first i tried with minutes not months, to see if it is working when teh timer hits a certain value or time....
so, when the time comes, and the event is fired, a MsgBox is displayed, but as soon as i press OK, it comes up again and OK then again pops up...and so forth ..!!!????
What i tried:
im using a form as a MSgBox did not work
iused another timer for a separate evet or for the message box to close but i find that i am forced to place the msgbox in that condition i want triggered so its affected by the timer and loops.
i tried stopping the timer BEFORE the MSgBox, or disposing or myTimer.Disable=true any where in the form, but i get stuck coz one thing works and another fails...
i almost give up, i hope some one can help please.
i will attach a sample code of what is happening....and ya sorry on a side note i used (had to use a button activate the timer or enable it, dont know why but had to!)