I'm creating an application in vb.net (winforms).
In the mainform, I create 4 panels and every panel has around 15 controls. The form also has 4 buttons to switch the panels. Every button sets the current panel visible = false and another panel visible = true.
The form has a backgroundImage and the panels are transparent.
If I switch a panel, you see background being redrawn (it 'flickers'). I don't want that, so I came up with a solution: I set the background of the 4 panels with the same image and now the 'flickering' is gone, but the controls of the panels are drawn very slow - especially when a control of the first panel is on the same location as a control of the second panel.
I already tried doing 'SuspendLayout' and 'ResumeLayout', so that doesn't work for me.
I also tried doing a 'Refresh()' between the firstPanel.visible = false and the secondPanel.visible = true but then I get the 'flickering' again.
So, anybody has some solutions to make my application faster?
EDIT: Important to say that if I try the same without the backgroundImage, it works fine!