Hello,
I'm writing a program in c#, in which I create a flowlayoutpanel that contains a lot of panels. I have a button, and when the user clicks on it, I want to dispose the panels that I've created.
This is the code:
But looking at the Task Manager, I see that the memory usage doesn't decrease.
I've also tried to call to the garbage collector
but there is no difference.
Does anybody know how can I achieve this?
Thanks
I'm writing a program in c#, in which I create a flowlayoutpanel that contains a lot of panels. I have a button, and when the user clicks on it, I want to dispose the panels that I've created.
This is the code:
Code:
foreach (Control c in myFlowLayoutPanel.Controls)
{
((Panel)c).Dispose();
}
I've also tried to call to the garbage collector
Code:
GC.Collect();
Does anybody know how can I achieve this?
Thanks