Sunday, August 23, 2009

"PrintForm" Component, available in .NET 3.5 SP1

An alternative use the 'PrintForm' component, which is available now in .NET 3.5 SP1 or available as a separate download . Here is Some sample code:

Place a ToolstripButton on to the Form :

private void toolStripButton2_Click(object sender, EventArgs e)
{
if (this.ActiveMdiChild == null)
return;
printForm1.Form = this.ActiveMdiChild;
printForm1.PrintAction = System.Drawing.Printing.PrintAction.PrintToPreview;
printForm1.Print();
}

No comments:

Post a Comment

Followers