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 Form.Close()
better or Form.Dispose()
?
MSDN says that all resources within the object are closed and the form is disposed when a Close is invoked. Inspite of which, I have come across several examples online which follow a Dispose rather than a Close.
Does one have an advantage over the other? Under which scenarios should we prefer one over the other?
form.Visible = false;
you can callform.Hide()
. In fact,form.Hide()
simply setsthis.Visible = false;
. – Vincenz