【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-FMDSP.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form FMDSP
Caption = "Form1"
ClientHeight = 5010
ClientLeft = 60
ClientTop = 345
ClientWidth = 4635
LinkTopic = "Form1"
ScaleHeight = 5010
ScaleWidth = 4635
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox TB_TEXT2
Height = 375
Left = 960
MaxLength = 20
TabIndex = 11
Text = "line 2 test"
Top = 2400
Width = 3500
End
Begin VB.CommandButton Command3
Caption = "清除显示器界面"
Height = 615
Left = 120
TabIndex = 9
Top = 3600
Width = 4440
End
Begin VB.TextBox TB_TEXT1
Height = 375
Left = 960
MaxLength = 20
TabIndex = 8
Text = "LINE 1 TEST"
Top = 1920
Width = 3500
End
Begin VB.CommandButton Command1
Caption = "测试打印文字"
Height = 615
Left = 120
TabIndex = 7
Top = 2880
Width = 4425
End
Begin VB.CommandButton Command2
Caption = "关闭窗口"
Height = 615
Left = 960
TabIndex = 6
Top = 4320
Width = 3615
End
Begin VB.Frame Frame1
Caption = "发票机连接口"
Height = 1335
Left = 120
TabIndex = 1
Top = 120
Width = 1335
Begin VB.OptionButton OB_PORT
Caption = $"FMDSP.frx":0000
Height = 255
Index = 0
Left = 120
TabIndex = 5
Top = 240
Width = 1000
End
Begin
VB.OptionButton OB_PORT
Caption = "COM2"
Height = 255
Index = 1
Left = 120
TabIndex = 4
Top = 480
Width = 1000
End
Begin VB.OptionButton OB_PORT
Caption = "COM3"
Height = 255
Index = 2
Left = 120
TabIndex = 3
Top = 720
Width = 1000
End
Begin VB.OptionButton OB_PORT
Caption = "COM4"
Height = 255
Index = 3
Left = 120
TabIndex = 2
Top = 960
Width = 1000
End
End
Begin VB.TextBox TB_MEMO
Height = 1695
Left = 1560
MultiLine = -1 'True
TabIndex = 0
Text = "FMDSP.frx":0009
Top = 120
Width = 3015
End
Begin MSCommLib.MSComm MSComm1
Left = 120
Top = 4320
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
CommPort = 2
DTREnable = -1 'True
End
Begin VB.Label Label1
Caption = "打印文字"
Height = 255
Left = 120
TabIndex = 12
Top = 2460
Width = 1005
End
Begin VB.Label Label11
Caption = "打印文字"
Height = 255
Left = 120
TabIndex = 10
Top = 1980
Width = 1005
End
End
Attribute VB_Name = "FMDSP"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim STR As String
CPORT = 1
If OB_PORT(0).Value = True Then CPORT = 1
If OB_PORT(1).Value = True Then CPORT = 2
If OB_PORT(2).Value = True Then CPORT = 3
If OB_PORT(3).Value = True Then CPORT = 4
MSComm1.CommPort = CPORT
STR = ""
STR = STR & Chr(27) + Chr(91) + Chr(72)
STR = STR & TB_TEXT1.Text & vbNewLine
STR = STR & Chr(27) + Chr(91) + Chr(66)
STR = STR & TB_TEXT2.Text & vbNewLine
TB_MEMO.Text = STR & vbNewLine
MSComm1.PortOpen = True
MSComm1.Output = STR
MSComm1.PortOpen = False
End Sub
Private Sub Command3_Click()
Dim STR As String
CPORT = 1
If OB_PORT(0).Value = True Then CPORT = 1
If OB_PORT(1).Value = True Then CPORT = 2
If OB_PORT(2).Value = True Then CPORT = 3
If OB_PORT(3).Value = True Then CPORT = 4
MSComm1.CommPort = CPORT
STR = ""
STR = STR & Chr(27) + Chr(91) + Chr(72) + Chr(12)
TB_MEMO.Text = STR & vbNewLine
MSComm1.PortOpen = True
MSComm1.Output = STR
MSComm1.PortOpen = False
End Sub
Private Sub Command2_Click()
Unload FMDSP
End Sub