I am doing a web browser with multiple tabs and each tab probably will have a new website differs from the other tabs. now what i am trying to do is to print the page on a specific tab and the page might consists of multiple pages when i am trying to print. this is my code and the problem with the code is it is only printing one page and on the last tab had been opened. any suggestions:
//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();
}
This is how i did it: the Print document contains this code:
this is the print button: