|
-
Nov 3rd, 2004, 12:56 AM
#1
Thread Starter
Fanatic Member
[Solved] Determining child's existence
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.
Last edited by brown monkey; Nov 4th, 2004 at 08:23 PM.
-
Nov 3rd, 2004, 11:31 AM
#2
Code:
if (YourMDIForm.MdiChildren.Count == 0)
//there are no children forms open
else
//there are children forms
-
Nov 3rd, 2004, 08:42 PM
#3
Thread Starter
Fanatic Member
Hello Serge,
Thanks for the reply. It gives error saying System.Array does not contain a definition for Count. Here's my code
Code:
if(this.MdiChildren.Count>0)
padedit.SetValue("childstate",this.ActiveMdiChild.WindowState);
Am I missing something?
-
Nov 4th, 2004, 09:31 AM
#4
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
-
Nov 4th, 2004, 08:23 PM
#5
Thread Starter
Fanatic Member
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|