I close form with form.Dispose() but i have problem that all opened MessageBoxes does not close. They are still opened. How to close all MessageBoxes when closing form? Is this possible?
I am using compact framework 3.5
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.
This isn’t possible. MessageBox wraps the
user32.MessageBoxAPI, which blocks the thread that it is called on until the user responds. They’re designed to be modal and you’d have to kill your process to close them.You could write your own MessageBox implementation using forms, and use ShowDialog to make them modal. That way you could close them yourself.