SuperPrograman
SuperPrograman

Reputation: 1822

Get the result of a PrintDialog

Okay, in my program I am showing a printDialog and I want to be able to know if the user clicks the print button, or the cancel button. In all the examples online that I've seen, the printDialogs have OK buttons, instead of Print buttons.

For Example (code from msdn) :

System::Windows::Forms::DialogResult result = printDialog1->ShowDialog();
if ( result == ::DialogResult::OK )
{
   //printing code here
}

So without an OK button obviously this code is not going to work.

Anybody know how to tell if print button is clicked?

Upvotes: 0

Views: 825

Answers (1)

heavyd
heavyd

Reputation: 17731

The "Print" button returns DialogResult::OK so it is safe to check against that value.

In fact any of the dialogs that inherit from CommonDialog will return OK for success.

Upvotes: 1

Related Questions