Reputation:
How to print a whole winform in c# 2008.?
My form contains picturebox, 3 text boxes.
Upvotes: 2
Views: 2483
Reputation: 16903
Use the following code.
using Microsoft.VisualBasic.PowerPacks.Printing;
private void printButton_Click(object sender, EventArgs e)
{
printForm1.Print(this, PrintForm.PrintOption.ClientAreaOnly);
}
For PrintOptions See this link in MSDN
Upvotes: 0
Reputation: 49261
Use the PrintForm control in the Visual Basic PowerPack. It is available from the ToolBox in VS 2008 even in C# projects. I think it may have been added in SP1. More information here.
Upvotes: 1
Reputation: 48137
Thought it is possible to do without a 3rd party library, I have used PrintForm.Net in the past with success.
Upvotes: 0