Printing More than One Page (with graphics)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Greetings.
I develop a multiple forms applications with Microsoft Visual Studio
C++ .NET 2003 and I'd like to know how can I print more than one page
in my application. For printing one page, I do:


private: System::Void button1_Click(System::Object * sender,
System::EventArgs * e){
if(printDialog1->ShowDialog() == DialogResult::OK){
printDocument1->PrintPage += new PrintPageEventHandler(this,
&Form1::printDocument1_PrintPage); //Create the new event, for drawing
the page to print
printDocument1->Print(); //Once the page is ready, just print
it
}
}


private: System::Void printDocument1_PrintPage(Objec­t* sender,
PrintPageEventArgs* ev){
ev->Graphics->Draw...//I make the drawings to print
ev->HasMorePages = false
}


It works perfectly. But I don't knnw how to print two graphics pages,
one after another. Must I draw the both pages in the
printDocument1_PrintPage event? In the MSDN they tell me to use the
SetMaxPage in an override CView::OnPreparePrinting function to draw
more than onepage. How could I do this?
Any help will be very appreciated.

.


Quantcast