I want to open a window that will display some text like “Validating input” and hold it open until a method is finished. I can’t do this with messagebox. Any ideas guys?
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.
Unless I’ve misunderstood this sounds a tad cruel to the user, but you could do something like this:
A
MessageBoxis just a standard Windows Form shown as a modal dialog. If you don’t like the controls displayed on the form then you can create your own form and show it to the user as a modal dialog through theShowDialogmethod:Your
MyDialogform can then either perform the validation itself, or respond to notification that the validation has completed. Until the dialog has been dismissed the user won’t be able to interact with the rest of the app (just as when a message box is shown) and the dialog could even disable buttons / prevent the user from closing it until the validation has succeeded.If you do this and your modal dialog isn’t performing the validation then you should be aware that you will need to perform the validation on a background thread, as the UI thread will be tied up displaying the modal dialog.