If you add your code to the subroutine Form_Paint() I think you should be able to see your rectangles when redisplaying your form. This worked for me.
Private Sub Form_Paint()
For i = 0 To 100
'TextOut GetWindowDC(GetActiveWindow), 50 + 10 * i, 50, str, Len(str)
RetVal = Rectangle(GetWindowDC(GetActiveWindow), 20 + 10 * i, 40, 30 + 10 * i, 50)
'ProgressBar1.Value = i
Next
End Sub
Nick Parker
**So like children pointers should be left to grown ups. - Norm Alomond
**