为什么会这样:
using namespace System;
using namespace System::Windows::Forms;
...
if( MessageBox::Show("Really do it?", "Are you sure?", System::Windows::Forms::MessageBoxButtons::YesNo) == System::Windows::Forms::DialogResult::Yes )
{
Console::WriteLine("Do it!");
}
..当失败时:
using namespace System;
using namespace System::Windows::Forms;
...
if( MessageBox::Show("Really do it?", "Are you sure?", System::Windows::Forms::MessageBoxButtons::YesNo) == DialogResult::Yes )
{
Console::WriteLine("Do it!");
}
...出现以下错误:
error C2039: 'Yes' : is not a member of 'System::Windows::Forms::Form::DialogResult'
我假设 Visual Studio 正在获取 DialogResult 但我看不到它在哪里找到它?