📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "五彩清屏"
ClientHeight = 4425
ClientLeft = 60
ClientTop = 345
ClientWidth = 5580
LinkTopic = "Form1"
ScaleHeight = 4425
ScaleWidth = 5580
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "开始"
Height = 495
Left = 3480
TabIndex = 0
Top = 3480
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'设置清屏色
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -