I need help on determining wether there is or there is no child on my MDI parent. How do I know if my MDI Parent has child on it or has no child on it? Thank you.
Printable View
I need help on determining wether there is or there is no child on my MDI parent. How do I know if my MDI Parent has child on it or has no child on it? Thank you.
Code:if (YourMDIForm.MdiChildren.Count == 0)
//there are no children forms open
else
//there are children forms
Hello Serge,
Thanks for the reply. It gives error saying System.Array does not contain a definition for Count. Here's my code
Am I missing something?Code:if(this.MdiChildren.Count>0)
padedit.SetValue("childstate",this.ActiveMdiChild.WindowState);
Sorry.....MdiChildren actually returns an array, you have to check for length instead of Count, my bad (this happens when you type directly into the post)
Code:if (YourMDIForm.MdiChildren.Length == 0)
//there are no children forms open
else
//there are children forms
:bigyello:
Thank you.