我尝试了下面的代码,
Private void button1_click(object sender, EvenArgs e)
{
PrintDoument pd = new PrintDoument();
pd.PrintPage += new PrintPageEventHandler(this.printDocument_PrintPage1);
pd.Print();
}
Private void printDocument_PrintPage1(object sender, system.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString("Test 1",new Font("Arial",8,FontStyle.Regular), Brushes.Black,50,500);
e.Graphics.DrawString("Test 2",new Font("Arial",8,FontStyle.Regular), Brushes.Black,50,1000);
e.HasMorePages = true;
e.Graphics.DrawString("Test 3",new Font("Arial",8,FontStyle.Regular), Brushes.Black,50,2000);
e.HasMorePages = false;
}
我想在下一页打印“Test 3”字符串,但它只打印一页。请告诉我一个方法来做到这一点。