📄 frmomrtype.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmomrtype
BorderStyle = 1 'Fixed Single
Caption = "阅读机基本参数设置"
ClientHeight = 3975
ClientLeft = 45
ClientTop = 330
ClientWidth = 7185
Icon = "frmomrtype.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3975
ScaleWidth = 7185
StartUpPosition = 3 '窗口缺省
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
ForeColor = &H00000000&
Height = 1095
Left = 120
TabIndex = 4
Top = 2640
Width = 6855
Begin VB.CommandButton Command1
Caption = "..."
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4080
TabIndex = 7
Top = 360
Width = 1215
End
Begin VB.TextBox Sht_File
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 1560
TabIndex = 6
Top = 360
Width = 2415
End
Begin VB.CommandButton cmdLoadForm
BackColor = &H00FFC0C0&
Caption = "装载"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5400
TabIndex = 5
Top = 360
Width = 1335
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "选择格式文件"
Height = 375
Left = 240
TabIndex = 8
Top = 480
Width = 1455
End
End
Begin VB.Frame 请选择阅读机类型
Caption = "请选择阅读机类型"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2055
Left = 120
TabIndex = 0
Top = 240
Width = 6975
Begin VB.Timer MyTimer
Enabled = 0 'False
Left = 4680
Top = 240
End
Begin VB.ListBox DeviceList
BackColor = &H8000000F&
ForeColor = &H80000005&
Height = 1500
Left = 240
TabIndex = 3
Top = 360
Width = 1935
End
Begin VB.CommandButton cmdInstall
Appearance = 0 'Flat
Caption = "初始化"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4920
TabIndex = 2
Top = 960
Width = 1575
End
Begin VB.CommandButton cmdGetDeviceList
Caption = "获取设备列表"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 1
Top = 960
Width = 1575
End
End
Begin MSComDlg.CommonDialog cd1
Left = 3240
Top = 2400
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
End
Attribute VB_Name = "frmomrtype"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdLoadForm_Click()
OMR_Clear '需调用多个格式文件时,仅在第一次时调用 OMR_Clear
If OMR_LoadForm(Trim(Sht_File), "") <> 0 Then
MsgBox "不能装载格式文件--" & Sht_File, vbCritical, "警告"
Else
MsgBox "装载格式文件成功", vbInformation, "提示"
End If
' Print Device
End Sub
Private Sub Command1_Click()
cd1.FileName = ""
cd1.DialogTitle = "选择格式文件"
cd1.Filter = "格式文件(*.sht)|*.sht|所有文件(*.*)|*.*"
cd1.ShowOpen
If cd1.FileName <> "" Then
Sht_File.Text = cd1.FileName
Else
End If
End Sub
Private Sub cmdGetDeviceList_Click()
Dim s As String, s1 As String, s2 As String
Dim l As Long
s = Space(200)
s2 = Chr(13) + Chr(10)
l = OMR_GetDeviceList(s)
If l <= 0 Then
l = OMR_CRetMess(OMR_GetLastError(), s)
MsgBox s
Exit Sub
End If
Do While Len(s)
If InStr(1, s, s2) - 1 > 0 Then
s1 = Left(s, InStr(1, s, s2) - 1)
s = Right(s, Len(s) - Len(s1) - 2)
Else
s1 = s
s = ""
End If
DeviceList.AddItem (s1)
Loop
DeviceList.ListIndex = 0
cmdGetDeviceList.Enabled = False
End Sub
Private Sub cmdInstall_Click()
Device = OMR_Installed(OMR_GetDeviceNum(Trim(DeviceList.Text)))
Select Case Device
'Case Is = 0:
' MsgBox "初始化失败", vbInformation
Case Is > 0:
MsgBox "OMR初始化成功", vbInformation
Case Else:
MsgBox "初始化失败,请设置您的OMR设备类型", vbOKOnly + vbInformation, "提示"
End Select
End Sub
Private Sub Form_Load()
Device = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -