Previously i am using the code

DialogResult res = dlgPrint.ShowDialog();
if (res == DialogResult.OK)
{
// print the image.
document.Print();
}

when i use this code i am getting the problem of lost focus to print window.

If i use begininvoke() method to get focus on print window. when i clicked on print button i am not able to capture the result and print the document.

I had used the

PrintDialog dlgPrint = new PrintDialog();
dlgPrint.Document = document;
ShowThePrintDialog printD = new ShowThePrintDialog(dlgPrint.ShowDialog);
this.BeginInvoke(printD);


but not working