[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


What is the easiest way to print to a printer in VB.Net?

Posted on 2005-05-12
Medium Priority
Last Modified: 2010-04-23

I am new to VB.Net
If I wanted to Print "Hello" to a printer in a certain location what is the easiest way to do this?

Is there a ready made (function/Class) out there which will make printing easy, by just passing in various parameters?

(It appears to be a pity that they did not match vb.net slightly closer with VB6, and also include more controls like the shape control)


Question by:garyjos
1 Comment

Accepted Solution

jrcooperjr earned 375 total points
ID: 13991507
Unfortunately (or fortunately, depending on how you look at it) printing in vb.net is more complex than in vb6, but you have much more control over the printer and stuff that gets printed.
You will need to learn about the PrintDocument class (for which you will need to import a namespace called "Systems.Drawing.Printing" )... here is a good URL to get started:


Here you'll find an example of code to print a text file:

And here is a discussion of the changes in printing from VB6 to VB.NET:

At first glance, it looks like a real pain... but it is something you can get used to, and you'll realize that it's more complex only because you have a lot more control...

Have fun!!!


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

834 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