Search code examples
c#winformsdrawingrefresh

Switching winForms and how to avoid white rectangles


i have to do an application with more forms: i first create and load the forms, after that i hide all, showing just one of them. With some buttons i switch between the forms by showing and hiding them with the relative functions Show() and Hide() The problem is that when i show a form, all the controls for an instant begin some white rectangles, after that they were loaded correctly.

I've looked everywhere but i can't find any result. How can i resolve this issue?


Solution

  • I solved the problem by adding the properties FormBorderStyle = FormBorderStyle.Noneand DoubleBuffered = true in the constructor of a new form created with the designer. After that i've created an array of that type of form