Printer.Print in VB.Net

Posted on 2005-04-20
Last Modified: 2012-08-13

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


Question by:GSDOUG
    1 Comment
    LVL 2

    Accepted Solution

    The following links from the MSDN should be of assisstance;

    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!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    static class 3 44
    fix34  challenge 9 73
    method argument as final 1 54
    scoresAverage challenge 8 59
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now