跟着我.frm
来自「VB源码,是初学者的福因.让你很快掌握VB编程」· FRM 代码 · 共 107 行
FRM
107 行
VERSION 5.00
Begin VB.Form Form1
Caption = "跟着我"
ClientHeight = 1500
ClientLeft = 60
ClientTop = 390
ClientWidth = 3150
LinkTopic = "Form1"
ScaleHeight = 1500
ScaleWidth = 3150
StartUpPosition = 3 '窗口缺省
Begin VB.Label Label4
Caption = "临"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2160
TabIndex = 3
Top = 480
Width = 255
End
Begin VB.Label Label3
Caption = "光"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 2
Top = 480
Width = 375
End
Begin VB.Label Label2
Caption = "迎"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 1
Top = 480
Width = 375
End
Begin VB.Label Label1
Caption = "欢"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 0
Top = 480
Width = 375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
Dim dx12 As Double
Dim dx23 As Double
Dim dx34 As Double
dx12 = Label2.Left - Label1.Left
dx23 = Label3.Left - Label2.Left
dx34 = Label4.Left - Label3.Left
Label1.Left = X
Label1.Top = Y
Label2.Left = Label1.Left + dx12
Label2.Top = Y
Label3.Left = Label2.Left + dx23
Label3.Top = Y
Label4.Left = Label3.Left + dx34
Label4.Top = Y
Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Label2.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Label3.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Label4.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?