Thread: Visual c++

  1. #1
    deletedforumuser
    Guest

    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?

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    DestroyWindow(GetParent(this)); ?

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM