public ref class form3 : public System::Windows::Forms::Form { public: form3(void) { InitializeComponent(); timer1->Start(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~form3() { if (components) { delete components; } } private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) { DateTime datetime = DateTime::Now; this->label1->Text=datetime.ToString(); } System::Void form3_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) { if (MessageBox::Show("Do you Really Want to Exit?","Form3", MessageBoxButtons::YesNo,MessageBoxIcon::Question) == (System::Windows::Forms::DialogResult::Yes)) { timer1->Stop(); //i enabled timer //Application::Exit(); form3::Close(); } else { e->Cancel=true; } } }
if (MessageBox::Show("Do you Really Want to Exit?","Form3", ...
form3::Close();
this->Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)