• Question

  • Good evening
    I write a vb code that allows to make an automatic printing on a printer "epson" without a dialog box or button "print".
    now what I want the printer to do is this:
    When printing a ticket, it waits for the user to remove the ticket before it prints another one. the first ticket not removed blocks the arrival of the second ticket.
    here is my code:

     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        End Sub
     Private Sub Form1_Activated(ByVal sender As Object,
    ByVal e As System.EventArgs) Handles MyBase.Activated
                   PrintDocument1.PrinterSettings.PrinterName ="epson" 
            If PrintDocument1.PrinterSettings.IsValid Then

                'End If
            End If
        End Sub

    Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
            e.Graphics.DrawString(vbNewLine + vbNewLine + "NUMERO" + " " + ComboBox1.Text + "  ", New Font("Elephant", 20, FontStyle.Bold), Brushes.Black, 10, 15)

        End Sub
    Tuesday, April 24, 2018 8:54 PM

All replies

  • You will need to find the escape codes for the specific printer e.g. this page.

    Farther reading



    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, April 24, 2018 10:30 PM
  • i'm not satisfied
    Wednesday, April 25, 2018 9:38 PM
  • i don't know how can i put  epson codes in my vb code 
    Wednesday, April 25, 2018 9:39 PM
  • i don't know how can i put  epson codes in my vb code 

    You can send control commands directly to a printer using the code described here:

    Wednesday, April 25, 2018 9:49 PM