?
Solved

Printer.Print in VB.Net

Posted on 2005-04-20
1
Medium Priority
?
266 Views
Last Modified: 2012-08-13
Hi

I have some VB6.0 code that uses Printer.Print, the conversion process says I can't use that any more...what do I use instead?

I can't seem to find an easy answer in my MSDN

Cheers

Greg
0
Comment
Question by:GSDOUG
1 Comment
 
LVL 2

Accepted Solution

by:
Telumehtar earned 375 total points
ID: 13832032
The following links from the MSDN should be of assisstance;

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconprintdocumentcontroloverview.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskprintingtext.asp

You will want to add a PrintDocument component to your form, which will provide the ability to send data to the printer once again. I think there is a 'component-less class' way of doing it too, but the Component method should work fine.

Using the component, you should put the component on your form and then put your code to handle the printing in the 'PrintDocument.PrintPage' event handler. You should then be able to simply call the 'PrintDocument.print' method to fire your stuff to your printer.

Good luck!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Progress
Introduction to Processes

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question