i wanna make my own minesweeper game, using c#, how do i do the visual part, the button, if i use like 400 buttons it takes time to draw them all, how does the original game make the more than 500 buttons immediately?
Name:
Anonymous2008-07-10 7:11
Try using one control handling drawing, mouse and keyboard events yourself.
a loop? i use one to make the buttons.
but if i make like 144 buttons it takes a few second to draw them all, the original game makes 667 in no time, how?
sorry if i misunderstood u, in that case can u explain a little bit more.
>>5
Yeah, I think chapter 5 is the one that covers minesweeper.
Name:
Anonymous2008-07-10 8:08
I have no experience with c#, but your problem is most probably this:
It takes time to create buttons, not show them. Create one element that will hold all your buttons, make it invisible, create all your buttons on it (not on form), and then show this element.
Original minesweeper uses RAW winapi and has no relation to what you're doing whatsoever.
Name:
Anonymous2008-07-10 9:02
dude that's raw
Name:
Anonymous2008-07-10 9:15
>>9 RAW NAKED BARE EXPOSED UNABSTRACTED REVEALED OPEN PUBLIC WINDOWS API
Name:
Anonymous2008-07-10 9:39
Why would creating hundreds of buttons be slow? What is your shitty API doing?
Name:
Anonymous2008-07-10 9:57
>>11
that's a good point, even javascript isn't that bad... data:text/html,<body><script>for(var i=0;i<2000;++i){var b=document.createElement('input');b.type='button';document.body.appendChild(b)}</script></body>
Try calling this.SuspendLayout(); and this.ResumeLayout(true); around the code which adds all the buttons.
Name:
Anonymous2008-07-10 14:22
Create a damn button class.
Name:
Anonymous2008-07-10 14:46
In HASKELL, we would create a button class, give it the necessary methods, create a loop that would make enough instances of the class and write a recursive factorial.
All work and no play makes Jack a dull boy
Allፀ work and no play makes鉇 Jack a dull䭇䕀 boy
All뢟ꉨ work and no play makes휅ꋰ Jack a dullꆳ boy
All⨜흓 work and no play makes턬흎 Jack a dullᏣ㖮 boy