You need to cancel your code.
The FormWithLotData constructor runs in the user interface thread. This is the stream that should show the form FormIsLoading. Therefore, instead of trying to display this form using a new stream, upload your data with it.
The method proposed by DoEvents that others have proposed is easiest to implement and (probably never did it by itself) may work well.
It is better to use a template to load data into a workflow. Before showing your FormWithLotData form, start loading the data into the background stream and display the "Download" dialog box. A method that loads data must have a callback method in the Load dialog box to signal when it should close (). After closing it, you can create a new FWLD, transfer the already downloaded data to it and show it.
Trying to load your data after the form has already been launched mixes your user interface with your data operations, making your form not only responsible for the user interface, but also responsible for finding the data. Bad for KISS and Single Responsibility, imho.
After your update, it seems that DoEvents will be the only real answer to your question, but with some caveats.
You cannot show another MODALLY shape while you are building your tree. You still have to do your hard work inside your form designer. You still have to hide your main form and Show () (not ShowDialog) your upload form. You will also need to call DoEvents at every possible moment, creating your tree. This is not an entirely elegant solution, but it will probably be your best bet at this point.
Will source share