There are 2 forms, one of which is a form filled with one picture (Form3), the second (Form1) is a main one. When you click on the button in Form1 - Maine collapses this way, opening F3:
Form3 formButton = new Form3(); formButton.Owner = this; formButton.Show(); formButton.Opacity = 0; while (this.Opacity != 0) { Thread.Sleep(30); this.Opacity -= 0.1; } while (formButton.Opacity != 1) { Thread.Sleep(30); formButton.Opacity += 0.1; } The problem is that when you appear while the loop is running, there is nothing on the form but holes from the elements. The elements themselves are loaded only when the program exits the loop.
Here is the reverse return of Maine:
formMain.Opacity = 0; formMain.Show(); while (formMain.Opacity != 1) { Thread.Sleep(30); formMain.Opacity += 0.1; } while (this.Opacity != 0) { Thread.Sleep(30); this.Opacity -= 0.1; } Maybe someone has a simple or not a solution to this problem. I would like the whole interface to appear smoothly, not just the form, and at the end instantly the elements.