Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ?

Jarod
Posted
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.
.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?
Posted

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 ?

Jarod

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...