barbiomalefico
February 13th, 2004, 03:36 AM
normally when i use a form in a C# application i write this sequence of operations:
public void ShowMyDialogBox()
{
Form2 testDialog = new Form2();
testDialog.ShowDialog(this);
}
Today i have take a look to the MSDN example and i have noticed the use of Dispose
public void ShowMyDialogBox()
{
Form2 testDialog = new Form2();
testDialog.ShowDialog(this);
testDialog.Dispose();
}
my question is, what really do this function and when i should use it?
public void ShowMyDialogBox()
{
Form2 testDialog = new Form2();
testDialog.ShowDialog(this);
}
Today i have take a look to the MSDN example and i have noticed the use of Dispose
public void ShowMyDialogBox()
{
Form2 testDialog = new Form2();
testDialog.ShowDialog(this);
testDialog.Dispose();
}
my question is, what really do this function and when i should use it?