新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click()
AutoRedraw = True
Cls
ScaleHeight = 4
ScaleWidth = 4
mycolor = 0
For h = 0 To 3
For w = 0 To 3
Line (w, h)-(w + 1, h + 1), QBColor(mycolor), BF
mycolor = mycolor + 1
Next w
Next
End Sub