Sunday 15 May 2011

winforms - Determine the print status c# -



winforms - Determine the print status c# -

i want show message box after user click print, tried below code, message box did not appear.

void printtoolstripmenuitem_click(object sender, eventargs e) { printfile(sender, e); } void printfile(object sender, eventargs e) { printdialog printdialog = new printdialog(); printdocument1.defaultpagesettings.landscape = true; printdialog.document = printdocument1; printdialog.useexdialog = true; if (dialogresult.ok == printdialog.showdialog()) { printdocument1.documentname = "document page print"; printdocument1.print(); messagebox.show("printed", "success", messageboxbuttons.ok, messageboxicon.information); } }

i want display message box after user click print button below image:

try:

var result = printdialog.showdialog(); if (result == dialogresult.ok) { ... }

c# winforms

No comments:

Post a Comment