📄 historyfrom.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form HistoryFrom
BackColor = &H00FFC0C0&
Caption = "History record"
ClientHeight = 6090
ClientLeft = 60
ClientTop = 345
ClientWidth = 9315
Icon = "HistoryFrom.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 6090
ScaleWidth = 9315
StartUpPosition = 3 '鈞岥銥徣
Begin VB.CommandButton save
BackColor = &H00008000&
Caption = "Save"
BeginProperty Font
Name = "SimSun"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7680
MaskColor = &H0080FF80&
Style = 1 'Graphical
TabIndex = 10
Top = 1560
Width = 1455
End
Begin VB.CommandButton dcButton3
BackColor = &H00008000&
Caption = "Open"
BeginProperty Font
Name = "SimSun"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7680
Style = 1 'Graphical
TabIndex = 9
Top = 720
Width = 1455
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Caption = "Print"
Height = 1335
Left = 7320
TabIndex = 7
Top = 4440
Width = 1935
Begin VB.CommandButton dcButton1
BackColor = &H00008000&
Caption = "Print"
BeginProperty Font
Name = "SimSun"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
Style = 1 'Graphical
TabIndex = 12
Top = 240
Width = 1335
End
Begin VB.CheckBox Check1
BackColor = &H00FFC0C0&
Caption = "Only print selection"
Height = 495
Left = 240
TabIndex = 8
Top = 720
Width = 1215
End
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "Delete"
Height = 1455
Left = 7320
TabIndex = 5
Top = 2760
Width = 1935
Begin VB.CommandButton DeleteList
BackColor = &H00008000&
Caption = "Delete"
BeginProperty Font
Name = "SimSun"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 540
Left = 360
Style = 1 'Graphical
TabIndex = 11
Top = 240
Width = 1335
End
Begin VB.CheckBox Check2
BackColor = &H00FFC0C0&
Caption = "Backup List befor delete"
Height = 495
Left = 240
TabIndex = 6
Top = 840
Value = 1 'Checked
Width = 1455
End
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 7560
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin RichTextLib.RichTextBox Record
Height = 5415
Left = 120
TabIndex = 0
Top = 600
Width = 7095
_ExtentX = 12515
_ExtentY = 9551
_Version = 393217
BackColor = -2147483624
BorderStyle = 0
Enabled = -1 'True
ScrollBars = 3
DisableNoScroll = -1 'True
TextRTF = $"HistoryFrom.frx":08CA
End
Begin VB.Label Label8
BackColor = &H00800000&
BorderStyle = 1 'Fixed Single
Caption = " 2D code data"
ForeColor = &H8000000E&
Height = 255
Left = 3120
TabIndex = 4
Top = 360
Width = 4095
End
Begin VB.Label Label6
BackColor = &H00800000&
BorderStyle = 1 'Fixed Single
Caption = " Record date"
ForeColor = &H8000000E&
Height = 255
Left = 840
TabIndex = 3
Top = 360
Width = 2295
End
Begin VB.Label Label2
BackColor = &H00800000&
BorderStyle = 1 'Fixed Single
Caption = " No.#"
ForeColor = &H8000000E&
Height = 255
Left = 120
TabIndex = 2
Top = 360
Width = 735
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFC0C0&
Caption = "History record list"
BeginProperty Font
Name = "SimSun"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2520
TabIndex = 1
Top = 0
Width = 2565
End
End
Attribute VB_Name = "HistoryFrom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim BackupPath As String 'Backup path befor delete data
Private Sub dcButton1_Click()
On Error GoTo Errhandler
CommonDialog1.CancelError = True
CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
If Check1.Value = "1" Then
If Record.SelLength = 0 Then
a = MsgBox("Please select content to print.", vbInformation)
Exit Sub
Else
CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
End If
Else
CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
End If
CommonDialog1.ShowPrinter
Record.SelPrint (CommonDialog1.hDC)
Errhandler:
Exit Sub
' a = MsgBox("Error occurent", vbExclamation, "ERROR")
End Sub
Private Sub dcButton3_Click()
CommonDialog1.DialogTitle = "Open file"
CommonDialog1.Filter = "TEXT FILES(*.TXT)|*.TXT"
CommonDialog1.ShowOpen
CommonDialog1.FilterIndex = 1
Openfrom.Record.LoadFile CommonDialog1.FileName
Openfrom.Caption = CommonDialog1.FileName
Openfrom.Show
End Sub
Private Sub DeleteList_Click()
If Check2.Value = "1" Then
Call save_Click
a = MsgBox("Data list is seved successful.Are you sure you want to delete list data?", vbExclamation + vbOKCancel)
If a = "1" Then
Record.Text = ""
Record.Text = "**************Last date of delete list:" & Now & "**************" + Chr$(13) + "**************Last save path:" + BackupPath + Chr$(13)
Else
Exit Sub
End If
Else
a = MsgBox("Are you sure you want to delete list data?", vbExclamation + vbOKCancel)
If a = "1" Then
Record.Text = ""
Record.Text = "**************Last date of delete list:" & Now & "**************" + Chr$(13)
Else
Exit Sub
End If
End If
End Sub
Private Sub Form_Load()
Record.LoadFile App.Path & "\HistoryRecord.inf"
Record.Text = Record.Text + Chr$(13)
End Sub
Private Sub Form_Unload(Cancel As Integer)
HistoryFrom.Record.SaveFile App.Path & "\HistoryRecord.inf"
End Sub
Private Sub save_Click()
On Error GoTo Errhandler
CommonDialog1.CancelError = True
CommonDialog1.DialogTitle = "Save to the data of 'Data list'"
CommonDialog1.Filter = "TEXT FILES(*.TXT)|*.TXT"
CommonDialog1.ShowSave
CommonDialog1.FilterIndex = 1
a = MsgBox(CommonDialog1.FileName, vbInformation + vbYesNoCancel, "SAVE")
If a = "6" Then
Record.SaveFile CommonDialog1.FileName, rtfText
BackupPath = CommonDialog1.FileName
End If
Errhandler:
Exit Sub
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -