Results 1 to 5 of 5

Thread: [Solved] Determining child's existence

  1. #1

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552

    Resolved [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.

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Code:
    if (YourMDIForm.MdiChildren.Count == 0)
        //there are no children forms open
    else
        //there are children forms

  3. #3

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    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?

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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

  5. #5

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552


    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
  •  



Click Here to Expand Forum to Full Width