📄 settime.frm
字号:
VERSION 5.00
Begin VB.Form settime1
AutoRedraw = -1 'True
BorderStyle = 5 'Sizable ToolWindow
Caption = "系统时间设置"
ClientHeight = 2520
ClientLeft = 60
ClientTop = 285
ClientWidth = 5325
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2520
ScaleWidth = 5325
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 100
Left = 3120
Top = 2040
End
Begin VB.CheckBox Check1
Caption = "当前系统时间"
Height = 360
Left = 360
TabIndex = 14
Top = 2040
Width = 1600
End
Begin VB.CommandButton Command2
Caption = "改变系统时间"
Height = 375
Left = 3720
TabIndex = 13
Top = 1440
Width = 1335
End
Begin VB.TextBox Text6
Height = 375
Left = 2640
TabIndex = 9
Top = 1440
Width = 615
End
Begin VB.TextBox Text5
Height = 375
Left = 1680
TabIndex = 8
Top = 1440
Width = 615
End
Begin VB.TextBox Text4
Height = 375
Left = 360
TabIndex = 7
Top = 1440
Width = 975
End
Begin VB.CommandButton Command1
Caption = "改变系统日期"
Height = 375
Left = 3720
TabIndex = 6
Top = 600
Width = 1335
End
Begin VB.TextBox Text3
Height = 375
Left = 2640
TabIndex = 4
Text = "Text3"
Top = 600
Width = 615
End
Begin VB.TextBox Text2
Height = 375
Left = 1680
TabIndex = 2
Text = "Text2"
Top = 600
Width = 615
End
Begin VB.TextBox Text1
Height = 375
Left = 360
TabIndex = 0
Text = "Text1"
Top = 600
Width = 975
End
Begin VB.Label Label7
Caption = "系统时间设置"
BeginProperty Font
Name = "楷体_GB2312"
Size = 20.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1320
TabIndex = 15
Top = 0
Width = 2535
End
Begin VB.Label Label6
Caption = "秒"
Height = 255
Left = 3360
TabIndex = 12
Top = 1560
Width = 255
End
Begin VB.Label Label5
Caption = "分"
Height = 255
Left = 2400
TabIndex = 11
Top = 1560
Width = 255
End
Begin VB.Label Label4
Caption = "时"
Height = 255
Left = 1440
TabIndex = 10
Top = 1560
Width = 255
End
Begin VB.Label Label3
Caption = "日"
Height = 255
Left = 3360
TabIndex = 5
Top = 720
Width = 255
End
Begin VB.Label Label2
Caption = "月"
Height = 255
Left = 2400
TabIndex = 3
Top = 720
Width = 255
End
Begin VB.Label Label1
Caption = "年"
Height = 255
Left = 1440
TabIndex = 1
Top = 720
Width = 255
End
End
Attribute VB_Name = "settime1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim aa As String
Private Sub Check1_Click()
If Check1.Value Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
Dim mydate As Date
mydate = DateSerial(Text1.Text, Text2.Text, Text3.Text)
Date = mydate
End Sub
Private Sub Command2_Click()
Dim mytime As String
mytime = TimeSerial(Text4.Text, Text5.Text, Text6.Text)
Time = mytime
End Sub
Private Sub Form_Load()
Text1.Text = Year(Date)
Text2.Text = Month(Date)
Text3.Text = Day(Date)
End Sub
Private Sub Timer1_Timer()
Text4.Text = Hour(Time)
Text5.Text = Minute(Time)
Text6.Text = Second(Time)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -