我试图用MyForm的C++的MessageBox有文字的按钮,它可以做的功能,如关闭或是和没有,但我发现了错误,当我尝试添加按钮到MessageBox本身。实例超载的MessageBox
错误:
'MessageBox的':暧昧的符号智能感知:没有重载函数实例
智能感知:没有重载函数的实例“系统:视窗:形式:: MessageBox :: Show“与参数列表 参数类型是:(const char [12],System :: Windows :: Forms :: MessageBoxButtons, System :: Windows :: Forms :: MessageBoxIcon)
我也用#include <windows.h>
代码:
private: System::Void autoriusToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Close:\n"
"Program?", MessageBoxButtons::OK);
}
private: System::Void apieProgramaToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Choose your answer", MessageBoxButtons::YesNoCancel, MessageBoxIcon::Exclamation);
}
不相关的问题,但如果你问你的用户“关闭程序?”,不要只给他一个“好”的选择! –
使用C++/CLI编写GUI应用程序确实不受支持;考虑使用C#代替。 –