Hi all,
Working in a Pos System and using this code for print all product from the list. The code wrk fine the only prb is:
The text begin printing from the middle of paper and not from the left side. Where is the prb?
This is the code:
Private Sub cmdPrint_Click()
Dim WhatDay$, Count%
Dim Tab1%, Tab2%, StoreCurrY%
If frmPOS.List1.ListCount = 0 Then
MsgBox "No has selectado ningun producto", , gStanCap
Exit Sub
End If
Printer.EndDoc
Tab1 = 0
Tab2 = 0
With Printer
.Font = "Courrier New"
.FontSize = 12
.FontBold = True
.FontUnderline = True
.FontSize = 12
.FontUnderline = False
Printer.Print
Printer.Print
.CurrentX = .CurrentX + 1
.FontBold = False
Printer.Print
Do
.CurrentX = Tab1
StoreCurrY = .CurrentY
Printer.Print frmPOS.List1.List(Count)
If Count + 1 = frmPOS.List1.ListCount Then .FontUnderline = True
.CurrentX = Tab2
.CurrentY = StoreCurrY
Printer.Print
Count = Count + 1
Loop While Count < frmPOS.List1.ListCount
.FontUnderline = False
.FontBold = True
.CurrentX = Tab2
.FontBold = True
.FontSize = 14
.CurrentX = (.Width - .TextWidth(" TOTAL:- " & frmPOS.txtTotal)) / 2
Printer.Print "TOTAL:- " & frmPOS.txtTotal
Printer.Print
.CurrentX = Tab1
.FontBold = True
.FontSize = 14
.CurrentX = (.Width - .TextWidth(" GRACIAS POR SU VISITA ")) / 2
Printer.Print " GRACIAS POR SU VISITA "
Printer.EndDoc
End With
End Sub
I`m using a epson tm-u220d and the paper size is 76x292 mm
Tks in advance
Costel