Print Windows Form in C# 2008

Hello,

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.
smetechitAsked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor 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;
    this.printForm1.Print();
}

Open in new window


The user will be shown the "select printer" dialog, at which point they can change page orientation as well.
0
 
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?
0
 
smetechitAuthor Commented:
My problem how to chnge printer settings to Landscape.
0
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.

All Courses

From novice to tech pro — start learning today.