I am new to C#, and I tried to look at the earlier posts but did not find a good answer.
In a C# Windows Form Application with a single form, is using
This forum on MSDN tells you.
Form.Close()sends the proper Windows messages to shut down the win32 window. During that process, if the form was not shown modally, Dispose is called on the form. Disposing the form frees up the unmanaged resources that the form is holding onto.
If you do a
Application.Run(new Form1()), Dispose will be called when
However, if you do
form1.ShowDialog()to show the form modally, the form will not be disposed, and you'll need to call
form1.Dispose()yourself. I believe this is the only time you should worry about disposing the form yourself.