It's supposed to create a 10x10 grid, and I added the image into the application resources. Each square is 20x20 pixels, and I loop by column. I thought it would work, but all I get is 6 images and the size just gets smaller.

Am I missing something? Or any good alternatives in creating a checkerboard without using PictureBox? Any thing with a MouseLeave, MouseHover, MouseClick, events I can use.

1 Answer
1

If you're just doing basic drawing, you can create a single control (perhaps a UserControl subclass) and override the OnPaint() method. See http://www.geekpedia.com/tutorial50_Drawing-with-Csharp.html for a sample tutorial. You'll also be able to override the various methods pertinent for mouse-handling.

I plan to update the image with the hover image and visited image for square that your hover on and already visited. Would would still advice the single control?
–
BombcodeMar 27 '11 at 4:24

1

Yes; in fact, the fewer controls (child windows) you have, the better your drawing performance generally will be. You can capture the mouse motion events for the main control and use them to compute the hovered cell, store that information, and access it while drawing.
–
Josh Petrie♦Mar 27 '11 at 4:33