Hi guys
I am working on a project where I need to send some plain text data to a printer using the generic text only print driver. I have done this many times in VB6 but am a little lost in VB.Net as to how to work with the printer.
For example in VB6 my code may look something like this
Can anyone assist me in how I should do something like this in VB.Net 2005?Code:Dim ZPLString As String For x = 0 To List2.ListCount - 1 ZPLString = "^FO" & CStr(lblParts.BCLeft) & "," & CStr(lblParts.BCTop) ZPLString = ZPLString & "^B3N,Y," & CStr(lblParts.BCHeight) & ",N,N" ZPLString = ZPLString & "^FD" & List2.List(x) & "^FS" & vbCrLf ZPLString = ZPLString & "^FO" & CStr(lblParts.TextLeft) & "," & CStr(lblParts.TextTop) ZPLString = ZPLString & "^A0,N," & CStr(lblParts.TextSize) & "," & CStr(lblParts.TextWidth) ZPLString = ZPLString & "^FD" & List2.List(x) & " " & "^FS" For y = 1 To Val(Text1.Text) Printer.Print "^XA" Printer.Print ZPLString Printer.Print "^XZ" Next Next Printer.EndDoc




Reply With Quote