i want to raise application.idle event manually in a Loop. is it possible in c# ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t raise the Application.Idle event manualy.
If your goal is to continue processing messages while in a loop, you can call Application.DoEvents() every so often during the course of the loop, but this will not cause the Application.Idle event to be raised.
If you need to process the Idle event while in a loop, you can run your loop on a background thread, which will keep the UI responsive.
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx