vijai
vijai

Reputation:

Print winform in C#

How to print a whole winform in c# 2008.?

My form contains picturebox, 3 text boxes.

Upvotes: 2

Views: 2483

Answers (3)

Sauron
Sauron

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

Jamie Ide
Jamie Ide

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

Brian Genisio
Brian Genisio

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

Related Questions