Printing - can´t print a second page
-
Hi there. I am having some problems printing. I made a form with some Label controls and other stuff. The problem is when I want to print, only what fits to one page gets printed out but nothing outside of the first page. For instance, a Label controls has the coordinates 65, 1650 doesn´t get printed but is shows up on screen. I know about HasMorePages but I just don´t know how to use it. I just need to be able to print out two pages, the first one is no problem but the second one is a problem, it doesn´t get printed at all :sigh: Can someone please help me? Thanks in advance, FJ
-
Hi there. I am having some problems printing. I made a form with some Label controls and other stuff. The problem is when I want to print, only what fits to one page gets printed out but nothing outside of the first page. For instance, a Label controls has the coordinates 65, 1650 doesn´t get printed but is shows up on screen. I know about HasMorePages but I just don´t know how to use it. I just need to be able to print out two pages, the first one is no problem but the second one is a problem, it doesn´t get printed at all :sigh: Can someone please help me? Thanks in advance, FJ
Try this: //Set the PrintDocument object property. //This sets the pages to be printed //Gets or sets the page number from which to start printing printDocument1.PrinterSettings.FromPage = 1; //Gets or sets the page number to which to print printDocument1.PrinterSettings.ToPage = 2; //This will print 2 pages from 1 to 2. :->
-
Try this: //Set the PrintDocument object property. //This sets the pages to be printed //Gets or sets the page number from which to start printing printDocument1.PrinterSettings.FromPage = 1; //Gets or sets the page number to which to print printDocument1.PrinterSettings.ToPage = 2; //This will print 2 pages from 1 to 2. :->
-
Try this: //Set the PrintDocument object property. //This sets the pages to be printed //Gets or sets the page number from which to start printing printDocument1.PrinterSettings.FromPage = 1; //Gets or sets the page number to which to print printDocument1.PrinterSettings.ToPage = 2; //This will print 2 pages from 1 to 2. :->
Hi. I just tried what you suggested but the outcome is still the same:( I do not know how to use the HasMorePages property. Do you have any ideas? In the program the stuff that comes on the second page doesn´t have to appear on screen, it would be just fine to let it only be printed out after the first page which would contain what is on the screen. Any help is appreciated. FJ
-
Hi. I just tried what you suggested but the outcome is still the same:( I do not know how to use the HasMorePages property. Do you have any ideas? In the program the stuff that comes on the second page doesn´t have to appear on screen, it would be just fine to let it only be printed out after the first page which would contain what is on the screen. Any help is appreciated. FJ
Here is an simple ideea on how to use the
HasMorePages
property. Declare a global variable that rembers the current page number (optional). In your print procedure do the adecvate printing taking account of the page borders. If your drawing must go onto the next page (mening that you encountered the end of the page), set theHasMorePages
to true and return from the proedure. Afther returning if the misterious procedure is setted to true the print procedure is called again with another page as an argument. Yes, in this algorithm you must take account of the page numer (or any other relating element) in order to achive a desired result. If you created an page number variable, before returning from the print method remember to increment the page. Hope this helps.protected internal static readonly ... and I wish the list could continue ...
-
Hi there. I am having some problems printing. I made a form with some Label controls and other stuff. The problem is when I want to print, only what fits to one page gets printed out but nothing outside of the first page. For instance, a Label controls has the coordinates 65, 1650 doesn´t get printed but is shows up on screen. I know about HasMorePages but I just don´t know how to use it. I just need to be able to print out two pages, the first one is no problem but the second one is a problem, it doesn´t get printed at all :sigh: Can someone please help me? Thanks in advance, FJ
private void Document_PrintPage(object sender, PrintPageEventArgs e){
// Do your printing stuff here// If you need to print any pages after this one,
// you set the HasMorePages property to true.
// If this is the last one, set it it to false
e.HasMorePages = true;
}HTH! :)
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.." -- Mark McCormick
|| Fold With Us! || Pensieve || VG.Net ||
-
private void Document_PrintPage(object sender, PrintPageEventArgs e){
// Do your printing stuff here// If you need to print any pages after this one,
// you set the HasMorePages property to true.
// If this is the last one, set it it to false
e.HasMorePages = true;
}HTH! :)
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.." -- Mark McCormick
|| Fold With Us! || Pensieve || VG.Net ||
Hi. I did try this but I couldn´t manage to make it work for some reason. I set the HasMorePages property to true after the printing code for the last item on my page. Then I added what I wanted on the second page and at the end of that code I set the HasMorePages property to false to stop the printing. Despite this my printer only prints out one page:(( What am I doing wrong? FJ
-
Hi. I did try this but I couldn´t manage to make it work for some reason. I set the HasMorePages property to true after the printing code for the last item on my page. Then I added what I wanted on the second page and at the end of that code I set the HasMorePages property to false to stop the printing. Despite this my printer only prints out one page:(( What am I doing wrong? FJ
Check this out: http://www.devarticles.com/c/a/C-Sharp/Printing-Using-C-sharp/