📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = " 时钟卡测试 "
ClientHeight = 1635
ClientLeft = 45
ClientTop = 330
ClientWidth = 6330
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1635
ScaleWidth = 6330
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer2
Left = 4320
Top = 0
End
Begin VB.CommandButton Command3
Caption = "退 出"
Height = 375
Left = 4800
TabIndex = 4
Top = 1080
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "读时钟卡内容"
Height = 375
Left = 4800
TabIndex = 3
Top = 600
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "按系统修改时间"
Height = 375
Left = 4800
TabIndex = 2
Top = 120
Width = 1455
End
Begin VB.Timer Timer1
Interval = 500
Left = 3840
Top = 0
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 285
Left = 240
TabIndex = 1
Top = 720
Visible = 0 'False
Width = 180
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 0
Top = 240
Width = 180
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private newPiTeDLLP As PiTeClass
Private Sub Command1_Click()
Dim AA
AA = MsgBox("确定修改时钟?", 1 + 32)
Select Case AA
Case 1
Set newPiTeDLLP = New PiTeClass
newPiTeDLLP.写时钟 = "改写时间"
End Select
End Sub
Private Sub Command2_Click()
Select Case Command2.Caption
Case Is = "读时钟卡内容"
Timer2.Interval = 500
Command2.Caption = "关闭时钟卡"
Label2.Caption = ""
Label2.Visible = True
Case Is = "关闭时钟卡"
Timer2.Interval = 0
Command2.Caption = "读时钟卡内容"
Label2.Visible = False
End Select
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Form1.Caption = " 时钟卡测试" & " 无设备连接"
Set newPiTeDLLP = New PiTeClass
newPiTeDLLP.写时钟 = "测地址"
Form1.Caption = " 时钟卡测试" & " " & newPiTeDLLP.IO地址
End Sub
Private Sub Timer1_Timer()
Dim AA
AA = Weekday(Date) - 1
Select Case AA
Case 1
AA = "星期一"
Case 2
AA = "星期二"
Case 3
AA = "星期三"
Case 4
AA = "星期四"
Case 5
AA = "星期五"
Case 6
AA = "星期六"
Case 0
AA = "星期日"
End Select
Label1.Caption = Date & " " & Time & " " & AA
End Sub
Private Sub Timer2_Timer()
Dim S1, S2, S3, S4, S5, S6, S7
newPiTeDLLP.读时钟 = 0
S1 = "0" & newPiTeDLLP.卡秒
S1 = Right(S1, 2)
S2 = "0" & newPiTeDLLP.卡分
S2 = Right(S2, 2)
S3 = "0" & newPiTeDLLP.卡时
S3 = Right(S3, 2)
S4 = newPiTeDLLP.卡星期
Select Case S4
Case 0
S4 = "星期日"
Case 1
S4 = "星期一"
Case 2
S4 = "星期二"
Case 3
S4 = "星期三"
Case 4
S4 = "星期四"
Case 5
S4 = "星期五"
Case 6
S4 = "星期六"
End Select
S5 = "0" & newPiTeDLLP.卡日
S5 = Right(S5, 2)
S6 = "0" & newPiTeDLLP.卡月
S6 = Right(S6, 2)
S7 = "0" & newPiTeDLLP.卡年
S7 = Right(S7, 1)
Label2.Caption = "200" & S7 & "-" & S6 & "-" & S5 & " " & S3 & ":" & S2 & ":" & S1 & " " & S4
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -