複数のタブで Web ブラウザーを実行していますが、各タブにはおそらく他のタブとは異なる新しい Web サイトがあります。今私がやろうとしているのは、特定のタブでページを印刷することです。印刷しようとすると、ページが複数のページで構成されている可能性があります。これは私のコードであり、コードの問題は、1 ページしか印刷されておらず、最後のタブが開かれていることです。助言がありますか:
//this is the printDocemnt from the toolbox
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Font font1 = new Font("Arial", 16, FontStyle.Regular);
e.Graphics.DrawString(rtb.Text, font1, Brushes.Black, 100, 100);//rtb.Text is a richtextbox object that i initialize in the beginning of the form
}
//this is the printbutton just a normal button
private void PrintButton_Click(object sender, EventArgs e)
{
printDialog1.ShowDialog();
printDocument1.Print();
}