MDI Mode Activate DocumentPane

2 posts, 0 answers
  1. Adam
    Adam avatar
    89 posts
    Member since:
    Mar 2008

    Posted 30 Sep 2008 Link to this post

    I'm trying to set  up a parent form with a menu along the top, and a tabbed MDI interface on the bottom.  Selecting items from the menu will create a new form if the form doesn't already exist, or select the existing form if it does.

    I am running into problems on selecting/activating the existing form.  I have tried activating the form object itself, I have tried finding the documentpane parent of the form and activating that. 

    Activating the documentpane selects the appropriate tab, but instead of showing the forms contents, it show a dark grey background.  What am I missing?

    Thanks!
  2. Adam
    Adam avatar
    89 posts
    Member since:
    Mar 2008

    Posted 30 Sep 2008 Link to this post

    I found the problem, it looks like in the case of trying to activate an existing form, I was setting the form's MDI Parent again and this was somehow causing the form not to show up.

    The following psuedo-code is close to what I used.

    if (not form exists)
    {
            new form()
            form.mdiparent = parent
            form.show()
    }
    else
    {
            documentpane.activate()
    }


    Thanks.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top