//Do they really want to exit program? private: System::Void btnQuit_Click(System::Object^ sender, System::EventArgs^ e) { //---easiest way I know of to handle return from MSGBOX... Make sure you include System::Windows::Forms in line 129! if (MessageBox::Show("Are you sure?", "System Message", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes) this->Close(); //braces are optional with one line of code else { MessageBox::Show("Then make up your mind!", "System Message", MessageBoxButtons::OK, MessageBoxIcon::Question); } }