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?
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?
Does this work?
PrintForm p = new PrintForm(this);
p.PrinterSettings.DefaultPageSettings.Landscape = true;
p.Print();
if you are doing this in VB then you want to look at Orientation as an example
if it's C# I am sure you can do the conversion
If p.Height > p.Width
{
p.Orientation = 1;//vbPRORPortrait
}
Else
{
p.Orientation = 2; //vbPRORLandscape
}
p.Print();