VC C++中怎么弹出带有 确定 和 取消 按钮的对话框?谢谢
我想弹出一个带有确定 和 取消 按钮的对话框,单击确定,就执行,单击取消就不执行?
谢谢
[解决办法]
// Initializes the variables to pass to the MessageBox::Show method.
String^ message = "You did not enter a server name. Cancel this operation?";
String^ caption = "No Server Name Specified";
MessageBoxButtons buttons = MessageBoxButtons::YesNo;
System::Windows::Forms::DialogResult result;
// Displays the MessageBox.
result = MessageBox::Show( this, message, caption, buttons );
if ( result == ::DialogResult::Yes )
{
// Closes the parent form.
this->Close();
}