• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 815
  • Last Modified:

Print Windows Form in C# 2008


I want to print a form that contains Visual Basic PowerPacks controls such as LineShape and RectangleShape and many labels, the form construct a very complex report.

I  want to print the form as Landscape and have a list of connected printers displayed.
  • 2
1 Solution
käµfm³d 👽Commented:
If you have PowerPacks installed, it should have come with a PrintForm control. Have you tried it? If so, are you saying that it doesn't work when using other PowerPack controls?
smetechitAuthor Commented:
My problem how to chnge printer settings to Landscape.
käµfm³d 👽Commented:
This worked for me:

Add a PrintDialog control to your form in addition to the PrintForm control. Then, add similar code to this:

if (this.printDialog1.ShowDialog() == DialogResult.OK)
    this.printForm1.PrinterSettings = this.printDialog1.PrinterSettings;

Open in new window

The user will be shown the "select printer" dialog, at which point they can change page orientation as well.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now