when I click button4 “Button4_Click”,
I can do other thing,such as input text on edittext.
and after a while, Printer_Connected showinfo ("print error")
may i wait for the callback Sub Printer_Connected (Success As Boolean) complte,and I do other thing.
Sub Button4_Click
If h_currdjh<>"" Then
If BTConnection.IsEnabled=False Then
Msgbox("蓝牙已关闭,不能打印!","信息提示")
Return
End If
BTConnection.Connect(pubcs.P_printerMac)
End If
End Sub
Sub Printer_Connected (Success As Boolean)
Dim PrintBuffer As String
Dim prtarray As List=PrintArray(h_currdjh)
If Success Then
Printer.Initialize2(BTConnection.OutputStream,"gbk")
Printer.Writeline(h_currdjh)
PrintBuffer=Chr(29)&"h"&Chr(60) '条码高度
Printer.Write(PrintBuffer)
PrintBuffer=Chr(29)&"w"&Chr(2) '条码款度
Printer.Write(PrintBuffer)
PrintBuffer=Chr(29)&"k"&Chr(23) & h_currdjh & Chr(0)
Printer.WriteLine(PrintBuffer)
Printer.WriteLine(Chr(13))
Printer.WriteLine(Chr(13))
Printer.Flush
Printer.Close
BTConnection.Disconnect
Else
Msgbox("请确认打印机是否连接正确!","print error")
End If
End Sub
I can do other thing,such as input text on edittext.
and after a while, Printer_Connected showinfo ("print error")
may i wait for the callback Sub Printer_Connected (Success As Boolean) complte,and I do other thing.
Sub Button4_Click
If h_currdjh<>"" Then
If BTConnection.IsEnabled=False Then
Msgbox("蓝牙已关闭,不能打印!","信息提示")
Return
End If
BTConnection.Connect(pubcs.P_printerMac)
End If
End Sub
Sub Printer_Connected (Success As Boolean)
Dim PrintBuffer As String
Dim prtarray As List=PrintArray(h_currdjh)
If Success Then
Printer.Initialize2(BTConnection.OutputStream,"gbk")
Printer.Writeline(h_currdjh)
PrintBuffer=Chr(29)&"h"&Chr(60) '条码高度
Printer.Write(PrintBuffer)
PrintBuffer=Chr(29)&"w"&Chr(2) '条码款度
Printer.Write(PrintBuffer)
PrintBuffer=Chr(29)&"k"&Chr(23) & h_currdjh & Chr(0)
Printer.WriteLine(PrintBuffer)
Printer.WriteLine(Chr(13))
Printer.WriteLine(Chr(13))
Printer.Flush
Printer.Close
BTConnection.Disconnect
Else
Msgbox("请确认打印机是否连接正确!","print error")
End If
End Sub