Printing in VS2008 C#

Posted on 2011-04-22
Last Modified: 2012-06-27
I am upgrading my application from vb6 to vs2008 C# using Microsoft.VisualBasic.powerpacks.
How would I go about converting the following code to something that would print a form in C#.
Or is there a better way?

For Each prnPrinter In Printers
    If prnPrinter.DeviceName = gstrReportPrinter Then
        Set Printer = prnPrinter
        Exit For
    End If

I have added: using Microsoft.VisualBasic.PowerPacks.Printing;

Thanks for your help!!
Question by:JDL129
    LVL 20

    Accepted Solution


    Author Comment

    Thanks for the response!!  

    I can't seem to find any of the examples that will print a form in C#.  All that I have found print the text from a text file.

    Any other suggestions?


    Author Closing Comment

    Thanks for the attempt!!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now