Hello,
I have a problem. How to use the VB.NET code to print a thermal printer?
In VB6 :
Dim lPrinter As Object
For Each lPrinter In Printers
If lPrinter.DeviceName Like "My_Printer" Then
Set Printer = lPrinter
Exit For
End If
Next lPrinter
Printer.Print "{XR;0000,0000,1050,2100,A|}"
...
Printer.EndDoc
In VB.NET ?
I tried this :
Private Sub Button_TestG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_TestG.Click
docToPrint.PrinterSettings.PrinterName = printer_g
docToPrint.Print()
End Sub
Private Sub document_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles docToPrint.PrintPage
e.Graphics.DrawString("My_code", New Font("Arial", 10), New SolidBrush(Color.Black), New PointF(0, 0))
End Sub
But this not work.
Have you got a solution?
Thanks