locked
Detect if a MDIchild is the last MDIchild RRS feed

  • Question

  • I want to detect if a form is the last/only MDIchild of a MDI Parent.


    meh
    Thursday, April 28, 2011 2:49 PM

Answers

  • If MdiParentForm.MdiChildren.Count = 1
    Thanks

    Social lounge for MSDN forum users :-)
    Living on Earth may be expensive, but did you know that it includes a free trip around the sun? Isn't that worth it?
    • Proposed as answer by Mike Feng Tuesday, May 3, 2011 8:58 AM
    • Unproposed as answer by Mike Feng Tuesday, May 3, 2011 9:06 AM
    • Proposed as answer by Mike Feng Tuesday, May 3, 2011 9:16 AM
    • Marked as answer by Mike Feng Friday, May 6, 2011 12:57 PM
    Friday, April 29, 2011 7:04 AM

All replies

  • If MdiParentForm.MdiChildren.Count = 1
    Thanks

    Social lounge for MSDN forum users :-)
    Living on Earth may be expensive, but did you know that it includes a free trip around the sun? Isn't that worth it?
    • Proposed as answer by Mike Feng Tuesday, May 3, 2011 8:58 AM
    • Unproposed as answer by Mike Feng Tuesday, May 3, 2011 9:06 AM
    • Proposed as answer by Mike Feng Tuesday, May 3, 2011 9:16 AM
    • Marked as answer by Mike Feng Friday, May 6, 2011 12:57 PM
    Friday, April 29, 2011 7:04 AM
  • Hi Meh,

     

    Thanks for posting in the MSDN Forum.

     

    Any update? I have marked Omie's reply as answer, if you think it provides no help, please unmark it, and  feel free to let me know your any concerns.

     

    Thank you for your understanding and support.

     

    Best Regards,
    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 6, 2011 12:57 PM
  • I'm programming in C# too now, so unless this thread hsould be moved; "Count" doesn't exist in c#, how would I do it?


    meh
    Thursday, May 19, 2011 7:58 PM
  • Hi Meh,

    please try this:

    if (this.MdiChildren.Count() == 1)
          {
          }
    

    I hope this will be helpful.

    Best regards,


    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Mike Feng Friday, May 20, 2011 1:48 AM
    Friday, May 20, 2011 1:48 AM