Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i m using a background worker ... i want after every 5 minutes it should pop up a messege need urgent help
Posted
Comments
Ganesh Nikam 8-Sep-12 0:40am    
use threading concept
Sergey Alexandrovich Kryukov 8-Sep-12 1:08am    
OP already trying to do that by using BackgroundWorker which creates and uses an extra thread.
--SA
[no name] 8-Sep-12 1:05am    
thanks buddy it helped
Sergey Alexandrovich Kryukov 8-Sep-12 1:08am    
:-)
Sergey Alexandrovich Kryukov 8-Sep-12 1:09am    
Do you still have a problem? If you do, you have to explain it using "Improve question", otherwise it's not clear what kind of help could help you... :-)
--SA

1 solution

I would not touch the backgroundworker too much and use a dispatchtimer.
See http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.aspx[^]
The problem with the backgroundworker is that it is on a different thread, and you cannot change GUI elements on a different thread than the GUI thread, except if you use the reportsprogress functionality. Moreover the backgroundworker does not track time. So just create a dispatchtimer when the backgroundworker starts, and remove it when the backgroundworker is done.
 
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