Is it possible to call ShowDialog(), but to create dialog window under main form, not on the top?
I’m calling ShowDialog because I want to stop executing the main program.
I don’t need the dialog window, because I will create many dialogs from threads and they will prevent each other.
You need to read synchronization of threads. For stopping executing code use
EventWaitHandleobject.Instead of creating and show dialog call
WaitOne()ofEventWaitHandle:A good example is on MSDN. Also note, that you need to call
Reset()before using blocking again or createEventWaitHandlewithEventResetMode.AutoResetoption (read more on MSDN).