-3
Here is the code that opens my Form4:
Form4 form4 = new Form4();
form4.Show();
// Aqui um código gigantesco que demora aproximadamente 1 minuto para ser executado.
form4.Close();
The problem is that while the Form4 is open, it is gray and static, not to move it or close. I understand that it gets kind of dependent on the code of the previous form, how to solve this?
more details of errors, exceptions
– Tiago NET
There is no exception.
– Ícaro Dantas
close ends the application execution. if you want to close the form without closing the app, Hide instead of Close
– Tiago NET
You have to run your code in another thread, or asynchronously, so as not to block the UI thread. There are several ways to do this. Try for example putting the "gigantic code". inside a
ThreadPool.QueueUserItem
. If you give more details of your question let me know, and I will formulate an answer.– Bruno Costa