Help, I can not do the following, show a waiting form while executing a process that contains another form, using backgroundworker

0

I wanted to see if they could help me I have tried several options but I still can not solve it, the problem is as follows.

I have a% main form1 that is a mdi , in a bar it is a button that makes the call to another form2 and add it as a child, but this form2 has several controls and enough operations so the load is slow and gives the impression that the app is labeled, then I wanted to put a form3 that contained a progressbar and that this would close when the form2 finished doing the operations so that I used a backgroundworker to do this.

The form3 is executed and the progress bar works perfectly, but here the real problem when finishing this task gives the following error: Controls created in a subprocess can not have primary controls in a control in a different subprocess. I already add this line CheckForIllegalCrossThreadCalls = false; but when executing this line that is the one that adds the form2 as a child of the form1 it throws the exception frmClient.MdiParent = this;

Thank you in advance

    
asked by Heyner Martinez 01.12.2018 в 17:13
source

0 answers