Help :)
-
I made a Minesweeper. But i have a problem... Every square in the program is a UserControl, and i use Bitmap for the imagens, setting the Background... In the Master Level ( 50x50 ) the program is extremlly heavy and laggy :( What can i do? Other methods to put the images? Thanks.
-
I made a Minesweeper. But i have a problem... Every square in the program is a UserControl, and i use Bitmap for the imagens, setting the Background... In the Master Level ( 50x50 ) the program is extremlly heavy and laggy :( What can i do? Other methods to put the images? Thanks.
Don't use a
UserControl
when a simpleControl
will do.UserControl
s are containers and have a lot of overhead.Controls
are simple objects - like aButton
, which might be a better control to extend for your use - and would have less overhead. But, realistically, don't use a control at all. Use a single control (perhaps even theForm
itself) that manages the grid and draws the grid accordingly, as well as handling the painting operations by overridingOnPaint
. This is a much more common approach and will have much less overhead than using eitherUserControl
s orControl
s. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]