Search code examples
c#winformsprintinglandscapepowerpacks

Printing the currently active window in landscape mode


I want to print the currently active WinForm in C#. Here is what I have:

using Microsoft.VisualBasic.PowerPacks.Printing;

PrintForm p = new PrintForm(this);
p.Print();

This works great for portrait mode. How can I print in landscape mode?


Solution

  • Does this work?

    PrintForm p = new PrintForm(this);
    p.PrinterSettings.DefaultPageSettings.Landscape = true;
    p.Print();