How to use the powerpack PrintForm? i want to print the winform.
+1
A:
First use the name space
using Microsoft.VisualBasic.PowerPacks.Printing;
Suppose you have two forms say Form1 and Form2. You have a print button in Form1 and on click the button you need to print Form2. Foe this do as
Form 1
private void printButton_Click(object sender, EventArgs e)
{
Form2 f = new Form2();
f.Show();
}
Form 2
private void Form2_Load(object sender, EventArgs e)
{
this.Hide();
printForm1.Print(this, PrintForm.PrintOption.ClientAreaOnly);
this.Close();
}
Sauron
2009-09-15 03:46:36
Thank you Ortus, its working fine.
2009-09-15 04:01:31
Happy to help you.
Sauron
2009-09-15 04:03:31