I edit my print codes. but I found it didnt work. I don't know why. Please give me some suggestions. Thanks.
--------------------------------------------------------------------
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
PrintDialog Myprint = new PrintDialog();
Myprint.Document = printDocument1;
if (printDialog1.ShowDialog()==DialogResult.OK)
try
{
printDocument1.Print();
}
catch{
printDocument1.PrintController.OnEndPrint(printDocument1,new System.Drawing.Printing.PrintEventArgs());
}
}

How to print ?
ScubaBob
Hi frank,
I'm not sure if its because you made a typo copying the code to this forum but it looks like you have created two PrintDialog controls.
You created a new PrintDialog here
PrintDialog Myprint = new PrintDialog();
and then you referance printDialog1 in the if statement, you also fail to call the Myprint option.
Like I said I'm not sure (I'm kind of new to this myself).
Scott
AlanKohl
Not above reason.Thanks. I have solve all the problems.Because I dont edit print page events fuction.
I made a mistake. I look up some books. Before printdocument.print() is running, print page events fuction should be called.