📄 float.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00FF0000&
Caption = "Floating Clock"
ClientHeight = 3675
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3675
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdSw
Caption = "Click Here To Pause"
BeginProperty Font
Name = "Comic Sans MS"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 1
Top = 3240
Width = 4455
End
Begin VB.Timer Timer1
Interval = 200
Left = 4200
Top = 120
End
Begin VB.Label lblFR
BackColor = &H00FF0000&
Caption = "hh:mm:ss"
BeginProperty Font
Name = "Comic Sans MS"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 375
Left = 1560
TabIndex = 0
Top = 120
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim GoDown As Boolean
Dim GoRight As Boolean
Private Sub cmdSw_Click()
If InStr(UCase(cmdSw.Caption), "PAUSE") > 0 Then
cmdSw.Caption = "Click Here To Continue"
Timer1.Enabled = False
Else
cmdSw.Caption = "Click Here To Pause"
Timer1.Enabled = True
End If
End Sub
Private Sub Form_Load()
GoDown = True
GoRight = True
End Sub
Private Sub Timer1_Timer()
'set the speed in timer interval
lblFR.Caption = Format(Time, "hh:mm:ss")
If GoDown Then
lblFR.Top = lblFR.Top + 50
Else
lblFR.Top = lblFR.Top - 50
End If
If lblFR.Top >= 2760 Then
lblFR.Top = 2760
GoDown = False
End If
If lblFR.Top <= 120 Then
lblFR.Top = 120
GoDown = True
End If
If GoRight Then
lblFR.Left = lblFR.Left + 50
Else
lblFR.Left = lblFR.Left - 50
End If
If lblFR.Left >= 3240 Then
lblFR.Left = 3240
GoRight = False
End If
If lblFR.Left <= 120 Then
lblFR.Left = 120
GoRight = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -