📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form XTSJXS
BackColor = &H00FFC0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "操作系统运行时间:"
ClientHeight = 1170
ClientLeft = 4785
ClientTop = 3915
ClientWidth = 3675
ControlBox = 0 'False
FillStyle = 3 'Vertical Line
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 78
ScaleMode = 3 'Pixel
ScaleWidth = 245
ShowInTaskbar = 0 'False
Begin VB.Timer Timer1
Interval = 1000
Left = 0
Top = 0
End
Begin VB.Label Label4
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 180
Left = 1785
TabIndex = 2
Top = 870
Width = 90
End
Begin VB.Label Label3
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Left = 1770
TabIndex = 1
Top = 600
Width = 120
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 300
Left = 1740
TabIndex = 0
Top = 120
Width = 180
End
Begin VB.Menu popupmnu
Caption = "tc"
Visible = 0 'False
Begin VB.Menu clo
Caption = "背景颜色调整"
End
Begin VB.Menu tc
Caption = "关闭"
End
End
End
Attribute VB_Name = "XTSJXS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetTickCount Lib "kernel32" () As Long
Public Y As Long '初始机器运行时间
Public wz As Single '控件位置
Public zt As Integer '延时记数
Private Sub clo_Click()
ts.lngb = XTSJXS.BackColor
ts.lngf = XTSJXS.Label3.ForeColor
'启动调色板
ts.Show
ts.ctname = "XTSJXS"
End Sub
Private Sub Form_Load()
Dim t As Long '参数初始化
Dim s As String '时间
Dim d As String '日期
Dim sz(1) As String
读取 "xtsjxs", "left", sz(0), 主窗体.MyName
If sz(0) = "No" Then
Me.Left = (Screen.Width - Me.Width) / 2
Else
Me.Left = Val(sz(0))
End If
读取 "xtsjxs", "top", sz(1), 主窗体.MyName
If sz(1) = "No" Then
Me.Top = (Screen.Height - Me.Height) / 2
Else
Me.Top = Val(sz(1))
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbRightButton Then '右键菜单
PopupMenu popupmnu
End If
End Sub
Sub Form_Unload(Cancel As Integer)
写入创建 "xtsjxs", "left", Me.Left, 主窗体.MyName
写入创建 "xtsjxs", "top", Me.Top, 主窗体.MyName
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
主窗体.Show
End Sub
Private Sub tc_Click()
Unload Me '退出
主窗体.Show
End Sub
Private Sub Timer1_Timer()
t = GetTickCount \ 1000 '返回系统运行时间,当前时间、日期
dd = t - Y
hhh = dd \ 3600 '计算小时
mmm = (dd Mod 3600) \ 60 '计算分钟
sss = (dd Mod 3600) Mod 60 '计算秒
hh = t \ 3600
mm = (t Mod 3600) \ 60
ss = (t Mod 3600) Mod 60
Label2.FontSize = 18
Label2.Caption = hh & "小时" & mm & "分" & ss & "秒"
Label3.Caption = "运行秒数:" & t
Label4.Caption = "本程序运行时间 " & hhh & "小时" & mmm & "分" & sss & "秒"
End Sub
Private Sub tz_Click()
XTSJXS.Hide
时间控制.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -