Search code examples
c#mdichildren

How to get the number of open MDI children


In C#, how do you obtain the number of open MDI children windows? I could make my own counter, but I'm not sure if there's already some in-built functionality for this.

I tried using MdiChildren.Length but this consistently returned 0 even though there were multiple MDI children open already.

Thanks.


Solution

  • From your mdi container form this.MdiChildren.Length should return the correct count.