about Printing forms

E

e-mid

Hi;
i want to print some controls on a form. I capture controls then draw them
on print page. This is how i do it:
http://www.dotnet247.com/247reference/msgs/5/26236.aspx

now the problem is when i open a printpreview form, "generating previews"
dialog box is shown first and if it is in front of a control to be printed,
it is captured too.

how can i avoid it?

secondly, sometimes even if print page seems ok on the preview, images of
the controls are distorted when i print them.

what would be the reason?


and another question, how can i print multiple pages?
eg: i wanna put some controls on second page. There is HasMorePages
property. i do not figured how to use it

last question:
what is the usual way when i want to print texts of many textboxes to
prepare a report?

thank you very much.
 
H

Herfried K. Wagner [MVP]

* "e-mid said:
i want to print some controls on a form. I capture controls then draw them
on print page. This is how i do it:
http://www.dotnet247.com/247reference/msgs/5/26236.aspx

now the problem is when i open a printpreview form, "generating previews"
dialog box is shown first and if it is in front of a control to be printed,
it is captured too.

Take the screenshot before actually painting the bitmap that contains
the screenshot onto the printer. But yes, if there are parts of the
window hidden by another window, they cannot be captured.
and another question, how can i print multiple pages?
eg: i wanna put some controls on second page. There is HasMorePages
property. i do not figured how to use it

<URL:http://dotnet.mvps.org/dotnet/samples/printing/downloads/PrintingDemo.zip>
 
E

e-mid

Herfried K. Wagner said:
Take the screenshot before actually painting the bitmap that contains
the screenshot onto the printer. But yes, if there are parts of the
window hidden by another window, they cannot be captured.

when i click preview button, ppd.ShowDialog( ) is called , preview dialog
appears then and PrintPage event is handled where controls to be printed
are captured. At the same time, "generating previews" dialog with a progress
bar is shown until the generation of previews are finished, so it hides
some controls. i do not find a way to hide that dialog.

this sample is very good especially about how to use HasMorePages property.
thankz..
 
H

Herfried K. Wagner [MVP]

* "e-mid said:
when i click preview button, ppd.ShowDialog( ) is called , preview dialog
appears then and PrintPage event is handled where controls to be printed
are captured. At the same time, "generating previews" dialog with a progress
bar is shown until the generation of previews are finished, so it hides
some controls. i do not find a way to hide that dialog.

Why not call the capture mechanism before calling 'ppd.ShowDialog'?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top