-
Visual c++
Im using visual c++ Express edition compiler,
How can i make that after cliking Exit button , the program close?
Code:
this->button4->Cursor = System::Windows::Forms::Cursors::Hand;
this->button4->ForeColor = System::Drawing::Color::Black;
this->button4->Location = System::Drawing::Point(511, 319);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(182, 39);
this->button4->TabIndex = 4;
this->button4->Text = L"Quit";
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
Here's my Exit button code. What code should i put to make it Exit the program?
-
DestroyWindow(GetParent(this)); ?
-
Queatrix, you are hereforth forbidden to reply to topics addressing VC++.NET, MFC, and most anything else that doesn't concern the strict Windows API and logic. Jk.
You should be able to call this method from within your button click handler: http://msdn2.microsoft.com/en-us/lib...orm.close.aspx