ShowDialog doesn't make form modal
-
Hello there, I have a C# application and with in a thread am popping open another form using the ShowDialog() function. For some reason the form is not displayed as MODAL. I tried passing "this" and obviously that causes a problem as it cannot be used within a thread. The main C# application is a MDI and has multiple forms embedded in it. How can i make this form MODAL? Thanks!
-
Hello there, I have a C# application and with in a thread am popping open another form using the ShowDialog() function. For some reason the form is not displayed as MODAL. I tried passing "this" and obviously that causes a problem as it cannot be used within a thread. The main C# application is a MDI and has multiple forms embedded in it. How can i make this form MODAL? Thanks!
Don Guy wrote:
I tried passing "this" and obviously that causes a problem as it cannot be used within a thread.
The dialog should be created (and would then be owned) by the main-thread. You could pass the entire mainform to the thread as an argument, and when the dialog needs be shown, use the mainform to invoke[^] the code on the mainthread.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]