Re: Closing down a hierarchy of modal windows nicely

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi Michael,

The recursion is much nicer. I assume that the OP will probably find this
code to be more suitable.

--
Dave Sexton

"Michael C" <nospam@xxxxxxxxxx> wrote in message
news:Oa22QbeDHHA.4060@xxxxxxxxxxxxxxxxxxxxxxx
"Dave Sexton" <dave@jwa[remove.this]online.com> wrote in message
news:uXASoIeDHHA.1748@xxxxxxxxxxxxxxxxxxxxxxx
And I don't think your code is simpler at all, BTW. I've glanced at it
twice and I have no idea what it's doing - I'm just assuming that it
works :)

Here's a simplified version of mine. This required 4 lines of code in one
location in the app and does not require code in each form.

private void CloseChildForms(Form ParentForm)
{
foreach(Form form in ParentForm.OwnedForms)
{
CloseChildForms(form);
form.Close();
}
}

Michael



.


Quantcast