I'm using standart printer object to create printouts. But i can not create a print preview.
How can i create a print preview by printer object? All others tips other than printer object are welcome
If you are using the printer object then probably the easiest solution is to create a VB form with a PictureBox object. Then use the same code (somewhat) to print to the PictureBox object that you use to print to the printer object by substituting object names.
There will be a few differences, like using the Cls method instead of the NewPage method, but beyond that it depends on how elegant you want the app to look.
What continually surprises me is that VB programmers have been crying out for print preview functionality since at least VB3 (prior to that we Vb people was jsut pleased that we could print easily, so we never questioned the limitations...)
For Vb3, Vb4, VB5, and VB6 we have been fobbed off by Microsoft with - as GlennB correctly advises - workarounds involving using a PictureBox.
I bought a component to do it. In my case I use VSPrinter, part of VSView by componentOne. Instead of printing to the VB Printer I now print to VSPrinter, this handles preview, zooming, printing etc. Unless your previewing requirement is small then this is a far better way. You have to spend a little money.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.