得到答案,我复制如何从消息框
if ((MessageBox::Show(
"Are you sure that you would like to close the form?",
"Form Closing", MessageBoxButtons::YesNo,
MessageBoxIcon::Question) == DialogResult::No))
{
// cancel the closure of the form.
Application::Exit();
}
从msdn。当我编译这个我
1> ------构建开始:项目:TEST2,配置:调试的Win32 ------ 1>测试2.cpp 1> C:\用户\kredkołamacz\ documents \ visual studio 2010 \ projects \ test2 \ test2 \ Form1.h(103):error C2039:'No':不是'System :: Windows :: Forms :: Form :: DialogResult'的成员' 1> c:\ users \kredkołamacz\ documents \ visual studio 2010 \ projects \ test2 \ test2 \ Form1.h(16):请参阅'System :: Windows :: Forms :: Form :: DialogResult'的声明'> c :\ users \kredkołamacz\ documents \ visual studio 2010 \ projects \ test2 \ test2 \ Form1.h(103):error C2065:'No':未声明的标识符 ========== Build:0 succeeded, 1失败,0最新,0跳过==========
怎么了?如何解决这个问题?
使用:: System :: Windows :: Forms :: DialogResult :: No。谢谢。 (我现在不能接受这个答案) – asd 2010-09-23 08:58:46