How to check the return value of a messagebox
-
I have written a code to check the return value of a message box. But it doesn't work . My code is -------------------------------------- DialogResult^ res = MessageBox::Show("Network connection failed.,"Error in connection",MessageBoxButtons::RetryCancel,MessageBoxIcon::Warning,MessageBoxDefaultButton::Button1); if (res == System::Windows::Forms::DialogResult::Cancel) { Application::Exit(); } else if (res == System::Windows::Forms::DialogResult::Retry) { continue; } --------------------------------------------------------- Here both the if condition fails... In immediate window, the value of res is {...} Pls check it Thanks in advance Anvesh
-
I have written a code to check the return value of a message box. But it doesn't work . My code is -------------------------------------- DialogResult^ res = MessageBox::Show("Network connection failed.,"Error in connection",MessageBoxButtons::RetryCancel,MessageBoxIcon::Warning,MessageBoxDefaultButton::Button1); if (res == System::Windows::Forms::DialogResult::Cancel) { Application::Exit(); } else if (res == System::Windows::Forms::DialogResult::Retry) { continue; } --------------------------------------------------------- Here both the if condition fails... In immediate window, the value of res is {...} Pls check it Thanks in advance Anvesh
anveshvm wrote:
DialogResult^ res
do you want the ^ there? DialogResult is a value type, isn't it? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused:
-
anveshvm wrote:
DialogResult^ res
do you want the ^ there? DialogResult is a value type, isn't it? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused:
-