|
小弟最近想搞个16进制的打印软件,得到了一个VB的代码,可打印出来后却是乱码,不是条码的样子,大家给看看怎么回事,那里有问题:
Private Sub Command1_Click()
Dim a As Integer
Dim c As String
Dim b As Integer
Dim i As Integer
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Or Trim(Text3.Text) = "" Then
MsgBox "请输入您的SN!", vbExclamation, "注意"
Else
a = Text2.Text
b = Text3.Text
For i = 0 To b
c = Hex(a)
Text4.Text = Text1.Text & a
a = a + 1
Call Printsn_label
Next
End If
End Sub
Private Sub Printsn_label()
Printer.Print "^LH 0,10"
Printer.Print "^XA^F01,1^FD^FS"
Printer.Print "^FO110,155^A0,65,65^FD" + "SN: " + Left(Text4.Text, 12) + "^FS"
Printer.Print "^BY3,4.0^FO110,220^BCO,130,N,N,N,N^FD" + Left(Text4.Text, 12) + "^FS"
Printer.Print "^XZ"
Printer.EndDoc
' Text2.Text = Left(Text2.Text, 1)
End Sub
Private Sub Command2_Click()
End
End Sub |
|