private void cmdPrintScreen_Click(object sender, EventArgs e) { string File_nme = PrintScreen(); if (File_nme != "") { try { using (System.Diagnostics.Process oImageViewer = System.Diagnostics.Process.Start(@File_nme)) { oImageViewer.WaitForExit(-1); } } catch (Exception Ex) { MessageForm.ShowMessage("Screen print failed", String.Format("Unable to print the screen because{0}{1}", Environment.NewLine, Ex.Message), "", MessageFunction.OK, MessagingIcon.Information, MessagingSounds.None); } finally { File.Delete(File_nme); } } }