Hi there.
I made a form with some Label controls on and lines and stuff. I have managed to make the computer print it. However, I would now like to add some code that will allow me to print out a second page with stuff. There is where my problem lies :-( The following code I added right after coding the very last thing that gets printed on the first page so the following is supposed to be printed on the second page:
e.HasMorePages = true;
Label svar1 = new Label();
svar1.Font = new Font("Times Roman", 12);
double result = double.NaN;
result = double.Parse(tnr1.Text) + double.Parse(tnr2.Text);
svar1.Text = result.ToString();
f.DrawString(svar1.Text, svar1.Font, new SolidBrush(svar1.ForeColor),
65, 1650);
e.HasMorePages = false;
This however yields nothing, only the first page gets printed. Can someone please help me? What am I missing?
Best regards,
Mike GoldPosted Jan 3, 2006, 5:05 PM
You need to keep setting the HasMorePages flag until all pages are printed in the Print_Page event handler of the PrintDocument. Check out my article NotePad.NET to see how this is done.
http://www.c-sharpcorner.com/UploadFile/mgold/NotepadDotNet07312005142055PM/NotepadDotNet.aspx