Question about modal forms and flows

In the main thread, I need to do the following:

  • Create a second thread where I show a modal form that will act as an β€œactivity indicator”
  • Run the task (this task MUST be executed from the main thread)
  • Close the form created in the second stream.

The question is that I don’t know how to show the modal form and not stop the main thread.

Any suggestion?

+3
source share
1 answer

I would use ThreadPool thead ... something like ...

ThreadPool.QueueUserWorkItem(o => dlg.Show());

This will launch the dialog in a separate thread. Your main thread will continue processing.

+2
source

Source: https://habr.com/ru/post/1720693/


All Articles