Re: show dialog result?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"iwdu15" <iwdu15@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6DF4CA33-B705-47FA-96D1-9DF936107D1F@xxxxxxxxxxxxxxxx
> hi, im a relative noob to C++ so im wondering how u can tell if the user
> pushed the "ok" button on a show dialog, like the equivilent of VB.net's
> "if
> showdialog = dialogresult.ok then
>
> heres the code i have to show a savefiledialog
>
> private: System::Void btnsave_Click(System::Object * sender,
> System::EventArgs * e)
> {
> this ->saveFileDialog1->set_Filter("TXT *.txt|(*.txt)|Doc
> *.doc|(*.doc)");
> this ->saveFileDialog1->set_FilterIndex(0);
> this->saveFileDialog1->ShowDialog();
> }
>
> };
>
> --
> -iwdu15

Did you look at the online help? Try something like this...

if ( this->saveFileDialog1->ShowDialog() == DialogResult.OK )
{
// do stuff...
}

--
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


.


Quantcast