Jarod Posted October 15, 2003 Posted October 15, 2003 I have a panel with, say 100 buttons on it (MineSweeper-like game) In some cases (a mine has burst out) I want to hide all the buttons. So I simply do a loop avoer the controls and set Visible = False. To avoid flickering, I alo set SuspendLayout before the loop, and reset ResumeLayout after But there is still an awful flickering effect. Why ? How can I avoid that ? Quote Jarod
AndreRyan Posted October 15, 2003 Posted October 15, 2003 Why are you using more than 100 Buttons? You should use Form.Paint Event and draw the game area because that many buttons use a lot of memory unneccessarily. Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Jarod Posted October 15, 2003 Author Posted October 15, 2003 Yeah you are right. THt'as surely the best way, and then dealing with double buffering. But I was very lazy and didn't want to manage the 3Dlike style, the push effect and so on... Ok that's an opportunity to play with GDI+ But just to know, there is not a way to avoid the flickering if we have a lot of controls ? Quote Jarod
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.