We help IT Professionals succeed at work.

Printing in VS2008 C#

JDL129
JDL129 asked
on
379 Views
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
Next
PrintForm

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

Thanks for your help!!
Jerry
Comment
Watch Question

Senior Engineer
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
tapanpattanaik!!!!!!!!
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?

Thanks,
Jerry

Author

Commented:
Thanks for the attempt!!!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.