📄 dlgpdf.frm
字号:
VERSION 5.00
Begin VB.Form frmpdf
BorderStyle = 3 'Fixed Dialog
Caption = "Pdf条码设置"
ClientHeight = 4200
ClientLeft = 555
ClientTop = 2130
ClientWidth = 5955
Icon = "DlgPDF.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4200
ScaleWidth = 5955
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Frame Frame3
Caption = "纠错(ECC)"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 120
TabIndex = 16
Top = 2880
Width = 4335
Begin VB.ComboBox cbECCLevel
Height = 300
ItemData = "DlgPDF.frx":000C
Left = 1200
List = "DlgPDF.frx":0025
Style = 2 'Dropdown List
TabIndex = 18
Top = 480
Width = 855
End
Begin VB.TextBox txtECCPercent
Height = 285
Left = 3000
MaxLength = 2
TabIndex = 17
Text = "10"
Top = 480
Width = 735
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "ECC等级:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 240
TabIndex = 21
Top = 480
Width = 840
End
Begin VB.Label lblECCPercent
AutoSize = -1 'True
Caption = "百分比:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2160
TabIndex = 20
Top = 480
Width = 735
End
Begin VB.Label lblpercent
Caption = "%"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 19
Top = 480
Width = 255
End
End
Begin VB.Frame Frame2
Caption = "单元外形"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 120
TabIndex = 11
Top = 1680
Width = 4335
Begin VB.TextBox txtXScale
Height = 285
Left = 1320
TabIndex = 13
Text = "Text2"
Top = 480
Width = 615
End
Begin VB.TextBox txtYScale
Height = 285
Left = 3360
TabIndex = 12
Text = "Text3"
Top = 480
Width = 615
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "X放大系数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 120
TabIndex = 15
Top = 480
Width = 1050
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "Y放大系数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2160
TabIndex = 14
Top = 480
Width = 1050
End
End
Begin VB.Frame Frame1
Caption = "条形码外形"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 120
TabIndex = 3
Top = 240
Width = 4335
Begin VB.ComboBox cbAspect
Height = 315
ItemData = "DlgPDF.frx":0041
Left = 1200
List = "DlgPDF.frx":0054
TabIndex = 7
Text = "1:3"
Top = 360
Width = 855
End
Begin VB.CheckBox ckTrunc
Caption = "缩短型条码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 6
Top = 360
Width = 1575
End
Begin VB.TextBox txtRow
Height = 285
Left = 1200
TabIndex = 5
Text = "Text5"
Top = 840
Width = 855
End
Begin VB.TextBox txtCol
Height = 285
Left = 2880
TabIndex = 4
Text = "Text6"
Top = 840
Width = 855
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "外形比例:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 120
TabIndex = 10
Top = 360
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "行:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 720
TabIndex = 9
Top = 840
Width = 315
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "列:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 2400
TabIndex = 8
Top = 840
Width = 315
End
End
Begin VB.CommandButton btnDefault
Caption = "默认值"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 475
Left = 4680
TabIndex = 2
Top = 2040
Width = 1095
End
Begin VB.CommandButton CancelButton
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 475
Left = 4680
TabIndex = 1
Top = 1200
Width = 1095
End
Begin VB.CommandButton OKButton
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 475
Left = 4680
TabIndex = 0
Top = 360
Width = 1095
End
End
Attribute VB_Name = "frmpdf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public m_strProfile As String
Private Sub btnDefault_Click()
cbAspect.Text = "1:3"
txtRow = 0
txtCol = 0
ckTrunc.Value = 0
txtXScale = 2
txtYScale = 6
cbECCLevel.ListIndex = 0
txtECCPercent = 10
End Sub
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub cbECCLevel_Click()
If cbECCLevel.ListIndex = 0 Then
lblECCPercent.Enabled = True
txtECCPercent.Enabled = True
lblpercent.Enabled = True
Else
lblECCPercent.Enabled = False
txtECCPercent.Enabled = False
lblpercent.Enabled = False
End If
End Sub
Private Sub Form_Load()
Dim Profile As String
Dim res As Long
Dim buf As String
Dim I As Integer
On Error GoTo msgerror
If (Profile = "") Then
Profile = App.Path + "\MakeBarCode.ini"
Else
Profile = m_strProfile
End If
'提取pdf码的参数
buf = Space(20)
res = GetPrivateProfileString("PDF", "Aspect", "", buf, 20, Profile)
cbAspect.Text = buf
txtRow = GetPrivateProfileInt("PDF", "Rows", 0, Profile)
txtCol = GetPrivateProfileInt("PDF", "Cols", 0, Profile)
ckTrunc.Value = GetPrivateProfileInt("PDF", "Truncated", 0, Profile)
txtXScale = GetPrivateProfileInt("PDF", "XScale", 4, Profile)
txtYScale = GetPrivateProfileInt("PDF", "YScale", 12, Profile)
cbECCLevel.ListIndex = GetPrivateProfileInt("PDF", "ECCLevel", 0, Profile)
txtECCPercent = GetPrivateProfileInt("PDF", "ECCPercent", 10, Profile)
Exit Sub
msgerror:
MsgBox Err.Description
End Sub
Private Sub OKButton_Click()
Dim Profile As String
Dim res As Long
Dim buf As String
If (Profile = "") Then
Profile = App.Path + "\MakeBarCode.ini"
Else
Profile = m_strProfile
End If
'写入pdf码的参数
res = WritePrivateProfileString("PDF", "Aspect", cbAspect.Text, Profile)
res = WritePrivateProfileString("PDF", "Rows", txtRow.Text, Profile)
res = WritePrivateProfileString("PDF", "Cols", txtCol.Text, Profile)
buf = Str(ckTrunc.Value)
res = WritePrivateProfileString("PDF", "Truncated", buf, Profile)
res = WritePrivateProfileString("PDF", "XScale", txtXScale.Text, Profile)
res = WritePrivateProfileString("PDF", "YScale", txtYScale.Text, Profile)
res = WritePrivateProfileString("PDF", "ECCLevel", cbECCLevel.Text, Profile)
res = WritePrivateProfileString("PDF", "ECCPercent", txtECCPercent.Text, Profile)
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -