If my startform is Form1 and I will open Form2 from Form1 and press a button with this code on Form2.
Form2 will close.
Is it possible to write something here so the whole application will close wich meens both Form2 and Form1.

this->Close();

Recommended Answers

All 2 Replies

You can use the Application class from System.Windows.Forms (assuming we're talking about C++/CLI):

Application::Exit();

Thank you... That worked well...

You can use the Application class from System.Windows.Forms (assuming we're talking about C++/CLI):

Application::Exit();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.