Thanks to Patrik.
This example displays a light colored grid on a dark background.
When the form loads, the code calls a routine that builds a grid image and saves it in a bitmap. The grid image is only big enough to show one "square" in the grid so it doesn't take much memory.
The program sets the form's BackgroundImage property to this bitmap. That property is automatically repeated as necessary to tile the form so (1) the program doesn't need to make a big grid to cover the form and (2) if the form resizes it automatically covers the form with the tile.
See the code for details.
|