请帮助我是C#的新手,我有一个带有textbox1,textbox2和buttom1的windows窗体我想打印textbox1的值而不预览或让我直接告诉打印机没有任何交互,textbox值必须是我想要打印的字幕的数量,也是页码所有那些副本说如果我输入3它应该说第1/3页2/3 3/3请帮助和原谅我的英语 我的按钮
下面有以下代码private void button1_Click(object sender, EventArgs e)
{
PrintDocument printDocument = new PrintDocument();
printDocument.DefaultPageSettings.Landscape = true;
printDocument.DefaultPageSettings.PaperSize = new PaperSize("zed", 400, 850 );
//printDocument.PrinterSettings.Copies = 2;
printDocument.PrintPage += PrintDocumentOnPrintPage;
printDocument.Print();
答案 0 :(得分:0)
我确实解决了.copies问题,但stil无法解决页面编号,这里是我现在的代码
private void button1_Click(object sender, EventArgs e)
{
short numCopies = 0;
numCopies = Convert.ToInt16(textBox2.Text);
PrintDocument printDocument = new PrintDocument();
printDocument.DefaultPageSettings.Landscape = true;
printDocument.DefaultPageSettings.PaperSize = new PaperSize("zed", 400, 850 );
printDocument.PrinterSettings.Copies = numCopies;
printDocument.PrintPage += PrintDocumentOnPrintPage;
printDocument.Print();
}