O
osmarjunior
How to ensure that a form is disposed?
When I work with modal forms I do the following:
using (Form1 frm = new Form1())
{
frm.ShowDialog();
}
As far as I read, when it ends the using scope, the form is disposed.
But if I don't use modal forms, like this:
Form1 frm = new Form1();
frm.Show();
In this case, when the user clicks on the X button, or a close button,
the form is disposed?
Junior.
When I work with modal forms I do the following:
using (Form1 frm = new Form1())
{
frm.ShowDialog();
}
As far as I read, when it ends the using scope, the form is disposed.
But if I don't use modal forms, like this:
Form1 frm = new Form1();
frm.Show();
In this case, when the user clicks on the X button, or a close button,
the form is disposed?
Junior.