返回首页

我做的计费软件后,账单打印整个纸卷弹出(点阵)


引导我停止通过C#弹出纸张。| kalaiking

回答

评论会员:游客 时间:2012/02/06
?在VB或C#(你的问题标签标题同时显示)我总是生病点阵打印问题{S0的}反正我给你一堆,检查它!imgsrc=http://www.orcode.com/img/ico/smiley_dead.gif](入伙解决自己){A}{A2}{A3的}{A4纸}免费附件和你的好文章{A5的}请转换成VB代码的C#自己。顺便说一句,我觉得你是幸运的得到这方面的许多环节
kalaiking
评论会员:游客 时间:2012/02/06
http://support.microsoft.com/?kbid=322091
kalaiking
评论会员:游客 时间:2012/02/06
using系统;使用命名;使用System.ComponentModel;使用System.Data;使用System.Drawing使用System.Text;使用System.Windows.Forms使用System.IO;使用System.Drawing.Printing;使用的System.Data.SqlClient;命名空间PrintApp{NBSP公共部分Form1类:表格NBSP{私人的PrintDocumentprintDocument1=新的PrintDocument()NBSP私人字符串stringToPrint;NBSPINTcntng;市民向Form1(){NBSPNBSP的Ini​​tializeComponent()printDocument1。的PrintPage=新PrintPageEventHandler(printDocument1_PrintPage)}NBSPNBSP私人无效中button1_Click(对象发件人,EventArgs的五){查询字符串=将Application.StartupPath"\\使用text.txt";(StreamWriter的SW=新的StreamWriter(将Application.StartupPath"\\使用text.txt"))NBSP{NBSPsw.WriteLine("条例草案"WISE盈利报告");NBSP;}NBSPReadFile函数()printDocument1.Print()NBSP;NBSPNBSP}NBSP私人无效用readfile()NBSP{NBSP(StreamReader的SR=新的StreamReader(将Application.StartupPath"\\使用text.txt"))NBSP{NBSP。cntng=File.ReadAllLines(将Application.StartupPath"\\使用text.txt")长;(I=0;我LT;cntngI){BR}NBSP{NBSPNBSPNBSPstringToPrint=sr.ReadToEnd()NBSPNBSP}}NBSP;}NBSPNBSP私人无效printDocument1_PrintPage(对象发件人,PrintPageEventArgs的E)NBSP{INTcharactersOnPage=0;NBSP;NBSPlinesPerPage=0;NBSP字体printfont=新字体(的"TAMKural",10);e.Graphics.MeasureString(stringToPrint,printfont,e.MarginBounds.Size,StringFormat.GenericTypographicOUTcharactersOnPage,出linesPerPage)NBSPe.Graphics.DrawString(stringToPrint,printfont,Brushes.Black,e.MarginBounds,StringFormat.GenericTypographic)stringToPrint=stringToPrint.Substring(charactersOnPage)NBSP;e.HasMorePages(stringToPrint.LengthGT;0)NBSP}}}