五彩射线.frm
来自「VB源码,是初学者的福因.让你很快掌握VB编程」· FRM 代码 · 共 42 行
FRM
42 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3150
ClientLeft = 60
ClientTop = 390
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
Dim i As Integer
Dim color1 As Integer
Dim color2 As Integer
Dim color3 As Integer
Dim row As Single
Dim column As Single
Cls
Form1.Scale (-300, 150)-(300, -150)
For i = 1 To 100
row = 300 * Rnd
If Rnd < 0.5 Then row = -row
column = 150 * Rnd
If Rnd < 0.5 Then column = -column
color1 = Int(Rnd * 255)
color2 = Int(Rnd * 255)
color3 = Int(Rnd * 255)
Form1.Line (0, 0)-(row, column), RGB(color1, color2, color3)
Next i
End Sub
Private Sub Form_Load()
Randomize
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?