在POS打印上打印 - VB 2008 [英] Printing on a POS printing - VB 2008

查看:73
本文介绍了在POS打印上打印 - VB 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧



我已经创建了一个收据的程序,问题是我需要它打印在

热继续POS打印机。每张收据的长度不同。 Any1有任何想法

如何做到这一点?



要打印的项目来自列表框。我打印的代码是:



Hi all

I''ve created a program to make an receipt, problem is that I need it to print on a
thermal continues POS printer. Each receipt is a different length. Any1 has any ideas
on how to do this?

The items to print is from a list box. the code for my printing is:

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
    Dim fnt As New Font("Courier10 BT", 10, FontStyle.Regular, GraphicsUnit.Point)
    Dim ListBoxItem As String = String.Empty
    For Each LBItem As String In lstReciept.Items
        ListBoxItem = ListBoxItem & vbCrLf & LBItem
    Next
    ListBoxItem = ListBoxItem.Substring(vbCrLf.Length)
    e.Graphics.DrawString(ListBoxItem, fnt, Brushes.Black, 0, 0)
    e.HasMorePages = False
End Sub





您能否帮我查看列表框的大小,使其大小(宽度)与

相同我的收据。



谢谢



Can you also help me as to what size to set the list box so that it is same size (width) as
my receipt.

Thanks

推荐答案

您也可以尝试阅读 Microsoft POS for .NET [ ^ ]。与使用PrintDocument类相比,它具有使打印到POS打印机更容易的类。
You can also try reading up on Microsoft POS for .NET[^]. It has classes that make it much easier to print to a POS printer than using the PrintDocument class.


这篇关于在POS打印上打印 - VB 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆