The code uses the GetWindowRect API to find out the size of the form you're building. It then creates a brush, and uses that to build a series of rectangles based on the number you specified when you called the procedure (in my example I've used 2,500 - so it draws 2,500 rectangles, starting at 1/2,500 the size of your form up to the size of your form).

As far as I can see, having it as an MDI child shouldn't make a difference. I've tested it on an MDI child, and it still seems to work the same.

Sorry...