Previously i am using the code

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