Hi. I try to use Form.Close but It doesn't work. It fills PDA memory like
using Form.Dispose.
Also, I try Form.Close and Form.Dispose together, but It doesn't work too.
Our example project has the next structure:
Main Form with 4 buttons.
When user push a button it creates a open a new modal form. I use the next
code:
private void button2_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
Form_Articulos Ficha = new Form_Articulos(); // Creating the form
Cursor.Current = Cursors.Default;
Ficha.ShowDialog(); // Show form
Ficha.Close(); // Close the form
Ficha.Dispose(); // Free
}
I try with close, with dispose, without close, all combinations.
If we see pda's memory, we can see Main Form running and when we open a form
pushing one button, this form appears on pda memory. When we close the form,
it disappears, but it doesn't liberate memory occupation. When we close main
form and exit program, then memory is liberated.
What can we do?
Thanks.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
escribió en el mensaje news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,
Are you holding a reference to the form?
AFAIK there is no need to call Form.Dispose manually ,
Are you calling Form.Close ?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jorge" <jo***@sur-se.com> wrote in message
news:ep****************@TK2MSFTNGP04.phx.gbl... Hello. I use the following instructions to create and to show the
"forms": Form_Exportar Ficha = new Form_Exportar(); // Project has form_exportar
Ficha.ShowDialog();
Ficha.Dispose();
Nevertheless, if I do a follow-up of the memory occupation on the PDA, I
see
it's growing and It doesn't liberate itself . If I open and close
several times this form, the memory is dealing until there comes a moment in
which
the application gives a memory error (full).
What about Dispose function? What's happened? Does not dispose function
work?
What can I do in order to free forms?
Thank you