I am writing a Windows Forms application in C # that uses only one form. When I want to exit and close the application, I add the code
private void Defeat() { MessageBox.Show("Goodbye"); this.Close(); }
for the class Form1 : Form , which is the form class that Visual Studio created automatically. But when this code works, I get the following message:
An unhandled exception of type "System.Runtime.InteropServices.ExternalException" occurred in System.Drawing.dll
Additional Information: A general error occurred in GDI +.
Message Image:

What is the problem?
How do I exit the application?
SIMEL
source share