'设置清屏色
Dim bcolor
Private Sub Clscolor()
Randomize
bcolor = RGB(Int(Rnd * 256), Int(Rnd * 256), Int(Rnd * 256))
End Sub
'从左右两边到中间清屏
Private Sub ClrScrl()
Dim i As Integer
Clscolor
For i = 0 To ScaleWidth / 2
Line (i, 0)-(i, ScaleHeight), bcolor
Line (ScaleWidth - i, 0)-(ScaleWidth - i, ScaleHeight), bcolor
Next i
End Sub
'从中间到左右两边清屏
Private Sub ClrScr2()
Dim i As Integer
Clscolor
For i = ScaleWidth / 2 To 0 Step -1
Line (i, 0)-(i, ScaleHeight - 1), bcolor
Line (ScaleWidth - i, 0)-(ScaleWidth - i, ScaleHeight), bcolor
Next i
End Sub
'从上(顶)下(低)到中间清屏
Private Sub ClrScr3()
Dim i As Integer
Clscolor
For i = 0 To ScaleHeight / 2
Line (0, i)-(ScaleWidth, i), bcolor
Line (0, ScaleHeight - i)-(ScaleWidth, ScaleHeight - i), bcolor
Next i
End Sub
'从中间到上(顶)下(底)清屏
Private Sub ClrScr4()
Dim i As Integer
Clscolor
For i = ScaleHeight / 2 To 0 Step -1
Line (0, i)-(ScaleWidth, i), bcolor
Line (0, ScaleHeight - i)-(ScaleWidth, ScaleHeight - i), bcolor
Next i
End Sub
'菱形清屏,从四角向中心
Private Sub ClrScr5()
Dim i, j As Integer
Clscolor
For i = 0 To ScaleWidth Step 200
For j = 0 To ScaleHeight Step 200 * ScaleHeight / ScaleWidth
Line (i, 0)-(0, j), bcolor
Line (ScaleWidth - i, ScaleHeight)-(ScaleWidth, ScaleHeight - j), bcolor
Line (0, ScaleHeight - j)-(i, ScaleHeight), bcolor
Line (ScaleWidth - i, 0)-(ScaleWidth, ScaleHeight - j), bcolor
Next j
Next i
End Sub
'圆形清屏,由大至小从外围向中心
Private Sub ClrScr6()
Dim i As Integer
Clscolor
For i = ScaleWidth To 0 Step -3
Circle (ScaleWidth / 2, ScaleHeight / 2), i / 2, bcolor
Next i
End Sub
'圆形清屏,由小至大从中心向外围
Private Sub ClrScr7()
Dim i As Integer
Clscolor
For i = 0 To ScaleHeight Step 3
Circle (ScaleWidth / 2, ScaleHeight / 2), i / 2, bcolor
Next i
End Sub
Private Sub Command1_Click()
ClrScr7
ClrScr6
ClrScr5
ClrScr4
ClrScr3
ClrScr2
ClrScrl
End Sub