I need help. I am somewhat new programming in C#. I have a program that I need to print preview multiple pages, each page entirely with its own format and information for that page. I am manually programming the layout and format of the "fields" of each page using the g.DrawString, g.DrawLine, g.DrawRectangle, etc. commands. I am also using the PrintPage object native in Visual Studio 2008. I currently have everything running fine for page 1 of my document but I am unable to understand how to reference the next pages in the PrintPreview and have specific info appear on each page. Any help would be appreciated.
Loading
Matthew CatheyPosted Sep 5, 2008, 7:03 PM
Well I am answering my own question. How it is done:
1) Create a int variable for the page number (i.e. "intPageNumber = 0;") under the Form class
2) Add "HasMorePages = true;" and create a switch/case, each case is a page to the PrintPage event.
3) At the end of the PrintPage event, the intPageNumber needs to be incremented by 1 (i.e. intPageNumber = intPageNumber + 1;).
4) For the last page to be written add "HasMorePage = false;"