Add a "Yes/No" dialog

  • Thread starter Thread starter Steve Behman
  • Start date Start date
S

Steve Behman

I am using Visual C++ 8.0 Express Edition.

On certain events I would like to pop up the standard "Yes/No" dialog -- is
this possible and, if so, how is this done?
 
I am using Visual C++ 8.0 Express Edition.

On certain events I would like to pop up the standard "Yes/No" dialog -- is
this possible and, if so, how is this done?

It is possible, but the exact method depends on whether you're writing
a native or a managed application. For a native application, you'd use
MessageBox() WinAPI function with flag MB_YESNO. For a managed Windows
Forms application, you'd use System::Windows::Forms::MessageBox class,
and specifically, its Show() method with MessageBoxButtons.YesNo
argument. WPF has a MessageBox class as well, which probably has very
similar API - can't recall the specifics at the moment.
 
Back
Top