borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (VB and mysql)Next Topic (printing polygone and fill it with a color) New Topic New Poll Post Reply
AndreaVB Forum : Printing : How to use the printer Object in VB ?
Poster Message
geekvin
Level: Guest


icon How to use the printer Object in VB ?

Hi All,

I am new to this forum and also to VB. Can anyone of you guide me how to use the printer object in VB. I need to print a bill in my project and the printing should stop immediately after the footer of the bill is printed. Do let me know any help or tutorial websites for the same.

Thanking you in advance.

Regards,

Vinay.

16-08-2002 at 10:48 AM
| Quote Reply
amitinnani
Level: Guest

icon Re: How to use the printer Object in VB ?

Vinay,
The best help for Printer object is MSDN. Go through it. Printer object work like Printer.print "Text" but for formatting the text in it you will have to use the various methods availabe with printer object, like CurrentX, CurrentY and others. But for properly aligning the text you will have to work out with the length of page and length of text too. I will suggest go through the MSDN HElp for Printer object.

And you can use killdoc or related methods for stopping the print.

12-10-2002 at 04:15 AM
| Quote Reply
Filbert
Level: Guest

icon Re: How to use the printer Object in VB ?

when you use the print object to print, you have to literally re-build the entire form that you want to print, in your head.Then send each item on the form to the print object.
For example, if your header is a rectangle, you have to tell the print object to draw a rectangle at a certain x and y location, then you have to tell it to fill it a certain color, then tell it to print the text that you want in it.  Every single little thing on your form you have to do this way. It really isnt as bad as it sounds, cause you can create a routine that does all of that automatically.  If this sounds like the info your after, reply here and i'll send you the routine that will print almost everything you need,almost.  You still can modify it even further than it is, but i think it'll help you.

21-12-2002 at 11:18 PM
| Quote Reply
mrholtsr
Level: Guest

icon Re: Re: How to use the printer Object in VB ?



quote:
Filbert wrote:
when you use the print object to print, you have to literally re-build the entire form that you want to print, in your head.Then send each item on the form to the print object.
For example, if your header is a rectangle, you have to tell the print object to draw a rectangle at a certain x and y location, then you have to tell it to fill it a certain color, then tell it to print the text that you want in it.  Every single little thing on your form you have to do this way. It really isnt as bad as it sounds, cause you can create a routine that does all of that automatically.  If this sounds like the info your after, reply here and i'll send you the routine that will print almost everything you need,almost.  You still can modify it even further than it is, but i think it'll help you.


I would also like to have this information.  And thanks in advance.  I am trying to program VB5 to print all the records in my dataset which is a library inventory.  So far I can only get it to print one record at a time and each record is on a seperate sheet of paper which takes a lot of paper as I have a lot of books.  Ray
08-01-2003 at 01:47 AM
| Quote Reply
AndreaVB Forum : Printing : How to use the printer Object in VB ?
Previous Topic (VB and mysql)Next Topic (printing polygone and fill it with a color) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder